Data Gateway
БесплатноНе проверен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 st
Описание
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
Установка Data Gateway
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/charpz/mcp-data-gatewayFAQ
Data Gateway MCP бесплатный?
Да, Data Gateway MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Data Gateway?
Нет, Data Gateway работает без API-ключей и переменных окружения.
Data Gateway — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Data Gateway в Claude Desktop, Claude Code или Cursor?
Открой Data Gateway на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
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
автор: 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
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolRedis
Interact with Redis key-value stores.
автор: modelcontextprotocolSQLite
Database interaction and business intelligence capabilities.
автор: 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.
автор: 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
автор: 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
автор: 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.
автор: drakonkatCompare Data Gateway with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
