1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CursorとMCPサーバを連携し、PostgreSQLを操作する

Posted at

はじめに

CursorとMCPサーバを連携し、PostgreSQLを操作する。

動かし方

下記リポジトリをcloneしてきます。

src/postgresで下記コマンドを実行する

 npx @modelcontextprotocol/server-postgres
 postgresql://user:password@host:port/db-name

Cursor側の設定

mcp.jsonの内容修正します。

mcp.json
{
	"mcpServers": {
		"postgres": {
			"command": "npx",
			"args": [
				"-y",
				"@modelcontextprotocol/server-postgres",
				"postgresql://user:password@host:port/db-name"
			]
		}
	}
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?