Python + FastAPI Stack for Windsurf
Configuration
{
"mcpServers": {
"postgres-mcp": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
],
"env": {
"POSTGRES_CONNECTION_STRING": "YOUR_POSTGRES_CONNECTION_STRING"
}
},
"docker-mcp": {
"command": "npx",
"args": [
"-y",
"docker-mcp"
]
},
"context7-mcp": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
},
"github-mcp": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PERSONAL_ACCESS_TOKEN"
}
},
"filesystem-mcp": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/directory"
]
}
}
}Where to save
Paste the config above into:
~/.codeium/windsurf/mcp_config.jsonEnvironment Variables
Replace the YOUR_ placeholders with your actual values.
POSTGRES_CONNECTION_STRINGrequiredPostgreSQL connection string (e.g. postgresql://user:pass@localhost:5432/mydb)
Used by: PostgreSQL MCP
GITHUB_PERSONAL_ACCESS_TOKENrequiredGitHub personal access token
Used by: GitHub MCP
What’s in this stack
Query and interact with PostgreSQL databases, inspect schemas, and run SQL directly from your AI editor.
FastAPI apps almost always use Postgres via SQLAlchemy or Tortoise. Query your database and inspect schemas without a separate tool.
Manage Docker containers, images, volumes, and networks. Run, stop, inspect, and monitor containers from your AI editor.
Python dependency management is notoriously fragile. Docker gives you reproducible environments from dev to production.
Pull up-to-date documentation and code examples for any library directly into your prompt context using the Context7 API.
FastAPI, Pydantic, and SQLAlchemy docs at your fingertips. These libraries have breaking changes between versions — current docs matter.
Access the GitHub API to manage repositories, issues, pull requests, branches, and workflows directly from your AI editor.
Manage your API repo, CI workflows, and code reviews. Python projects benefit from PR-based review to catch type issues early.
Read, write, search, and manage files on your local filesystem with secure directory-scoped access for your AI editor.
Read config files, write generated code, and manage project structure. Essential for scaffolding FastAPI's route-heavy file layout.