Skip to content

Commit dec36b5

Browse files
authored
Merge pull request #54 from GannaChernyshova/mcp-copilot-integration
added example of postgres mcp integration with github copilot
2 parents c68b854 + baf9ae0 commit dec36b5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.vscode/mcp.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"inputs": [
3+
// The "inputs" section defines the inputs required for the MCP server configuration.
4+
{
5+
"type": "promptString"
6+
}
7+
],
8+
"servers": {
9+
// The "servers" section defines the MCP servers you want to use.
10+
"postgres": {
11+
"command": "docker",
12+
"args": [
13+
"run",
14+
"-i",
15+
"--rm",
16+
"mcp/postgres",
17+
"postgresql://postgres:postgres@host.docker.internal:5432/catalog"
18+
]
19+
}
20+
}
21+
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ Once the development environment is up and running, the following URLs can be le
9090
- [http://localhost:5050](http://localhost:5050) - [pgAdmin](https://www.pgadmin.org/) to visualize the database. Login using the password `postgres` (configured in the Compose file)
9191
- [http://localhost:8080](http://localhost:8080) - [kafbat](https://github.com/kafbat/kafka-ui) to visualize the Kafka cluster
9292

93+
### Postgres MCP
94+
95+
You can use **Postgres MCP** with GitHub Copilot by running it with the [`mcp.json`](.vscode/mcp.json) file. [`Configuring MCP servers in Visual Studio Code`](https://docs.github.com/en/copilot/customizing-copilot/extending-copilot-chat-with-mcp#configuring-mcp-servers-in-visual-studio-code)
96+
97+
#### How to use:
98+
99+
1. Start the Compose
100+
2. Launch the application
101+
3. In the MCP config, click **Start** under the **Servers** section in [`mcp.json`](.vscode/mcp.json)
102+
4. In GitHub Copilot chat, select the **Agent** dropdown
103+
5. Ask a Postgres-related question, such as:
104+
> List the data from the products table
105+
93106
### Helper scripts
94107

95108
In the `dev/scripts` directory, there are a few scripts that can be used to interact with the REST API of the application.

0 commit comments

Comments
 (0)