Skip to content

yuefeng-cn/mcp-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

  • Install latest Node.js.

  • Clone this repository.

  • Run command: npm i && npm run build.

  • Add configuration in you IDE or other supported AI agents.

    • In VScode:

      Configuration file path: .vscode/mcp.json

      {
          "servers": {
              // you will see service start button here.
              "postgres": {
                  "command": "node",
                  "args": [
                      "/Users/xxx/project/personal/mcp-postgre/build/index.js" // the absolute path to your compiled JS file
                  ],
                  "env": {
                      "POSTGRES_HOST": "localhost",
                      "POSTGRES_PORT": "5432",
                      "POSTGRES_DB": "postgres",
                      "POSTGRES_USER": "postgres",
                      "POSTGRES_PASSWORD": "123456",
                  }
              }
          }
      }
      
    • In Cursor

      You can also add configuration by UI in Cursor Settings -> MCP, or configuration file path: .cursor/mcp.json.

      {
        "mcpServers": {
          "postgres": {
            "command": "node",
            "args": ["/Users/xxx/project/personal/mcp-postgre/build/index.js"], // the absolute path to your compiled JS file
            "env": {
              "POSTGRES_HOST": "localhost",
              "POSTGRES_PORT": "5432",
              "POSTGRES_DB": "postgres",
              "POSTGRES_USER": "postgres",
              "POSTGRES_PASSWORD": "123456"
            }
          }
        }
      }
      
  • And then, you can switch your copilot to Agent mode and ask som questions in AI chat window.

    • If you are using Cursor, ask questions directly.
    • If you are using VScode, start server manuraly first in mcp.json. You can also use Command + Shift + P, and type MCP into input box to run some commands, including start and stop MCP servers.

    image

To avoid strange problems, make sure you are using the latest VScode and Cursor.

See more details in https://modelcontextprotocol.io/quickstart/server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published