Data Gateway
FreeNot checkedPOC exploring the Model Context Protocol (MCP) — an .NET MCP server with Streamable HTTP and stdio transports, backed by a PostgreSQL database and exposed as st
About
POC exploring the Model Context Protocol (MCP) — an .NET MCP server with Streamable HTTP and stdio transports, backed by a PostgreSQL database and exposed as structured tools for AI agents.
README
A proof-of-concept MCP (Model Context Protocol) server built to explore how AI agents interact with structured data sources. The server exposes database query tools over two different transports, following the official MCP documentation.
Overview
This project demonstrates two ways to host an MCP server in .NET — one for remote/debugging scenarios and one for local client-launched workflows:
McpDataGateway/
├── Tools/ # MCP tool definitions — transport-agnostic
├── Host.Http/ # ASP.NET Core host using Streamable HTTP transport
└── Host.Stdio/ # Console host using stdio transport
The server is backed by a PostgreSQL database seeded with the Pagila sample dataset — a DVD rental store schema with films, actors, customers, rentals, and payments — providing a realistic dataset for demonstrating data retrieval tools.
Running with Docker Compose
The quickest way to get the full stack running locally (MCP HTTP server + PostgreSQL + pgAdmin).
First-time setup
Note: If you have a leftover
docker_local/postgresql/datadirectory from a previous run, delete it first so PostgreSQL re-initialises from the seed scripts:# Windows rmdir /s /q docker_local\postgresql\data # macOS / Linux rm -rf docker_local/postgresql/data
Start all services
docker-compose up -d
| Service | Address |
|---|---|
| MCP HTTP server | http://localhost:5000 |
| pgAdmin | http://localhost:5435 |
| PostgreSQL (host access) | localhost:5434 |
Connecting pgAdmin to PostgreSQL
Open
http://localhost:5435and log in with:- Email:
[email protected] - Password:
postgres
- Email:
Right-click Servers → Register → Server…
On the General tab, give it any name (e.g.
mcp-postgres).On the Connection tab, fill in:
Field Value Host postgresPort 5432Maintenance DB postgresUsername postgresPassword R0ck&R0llUse
postgres(the Docker container hostname) and port5432. Thelocalhost:5434address is only for connections from outside Docker.Click Save. The Pagila tables are visible under
postgres → Schemas → public → Tables.
Stop all services
docker-compose down
Running the HTTP Streamable host
Suitable for debugging, remote access, or connecting multiple clients simultaneously.
dotnet run --project McpDataGateway/Host.Http
The server starts on http://localhost:5000. Point your MCP client at:
{
"mcpServers": {
"mcp-data-gateway": {
"url": "http://localhost:5000/mcp"
}
}
}
Debugging in Visual Studio: Set
Host.Httpas the startup project and press F5. You can place breakpoints anywhere in theTools/project and trigger them via tool calls from your MCP client.
Running the stdio host
Suitable for local workflows where the MCP client spawns the server process directly.
dotnet run --project McpDataGateway/Host.Stdio
Configure your MCP client to launch the process:
{
"mcpServers": {
"mcp-data-gateway": {
"command": "dotnet",
"args": ["run", "--project", "path/to/McpDataGateway/Host.Stdio"]
}
}
}
Or point to the published executable after dotnet publish:
{
"mcpServers": {
"mcp-data-gateway": {
"command": "path/to/Host.Stdio.exe"
}
}
}
Choosing a transport
HTTP Streamable (Host.Http) |
stdio (Host.Stdio) |
|
|---|---|---|
| Breakpoint debugging | ✅ | ❌ |
| Multiple simultaneous clients | ✅ | ❌ |
| Remote / hosted deployment | ✅ | ❌ |
| MCP client manages the process | ❌ | ✅ |
| No separate server process needed | ❌ | ✅ |
Sample data
The PostgreSQL database is seeded with the Pagila sample database — an open-source PostgreSQL port of the Sakila MySQL example database, maintained by Devrim Gündüz.
Pagila is made available under the PostgreSQL License.
References
Installing Data Gateway
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/charpz/mcp-data-gatewayFAQ
Is Data Gateway MCP free?
Yes, Data Gateway MCP is free — one-click install via Unyly at no cost.
Does Data Gateway need an API key?
No, Data Gateway runs without API keys or environment variables.
Is Data Gateway hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Data Gateway in Claude Desktop, Claude Code or Cursor?
Open Data Gateway on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolRedis
Interact with Redis key-value stores.
by modelcontextprotocolSQLite
Database interaction and business intelligence capabilities.
by modelcontextprotocolmxcp
Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.
by raw-labstadas-github/a2asearch-mcp
MCP server to search 4,800+ MCP servers, AI agents, CLI tools and agent skills. Install: npx -y a2asearch-mcp. Ask Claude: "Find MCP servers for database access
by tadas-githubjulien040/anyquery
Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by desi
by julien040drakonkat/wizzy-mcp-tmdb
A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.
by drakonkatCompare Data Gateway with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
