Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

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

GitHubEmbed

Описание

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/data directory 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

  1. Open http://localhost:5435 and log in with:

  2. Right-click Servers → Register → Server…

  3. On the General tab, give it any name (e.g. mcp-postgres).

  4. On the Connection tab, fill in:

    Field Value
    Host postgres
    Port 5432
    Maintenance DB postgres
    Username postgres
    Password R0ck&R0ll

    Use postgres (the Docker container hostname) and port 5432. The localhost:5434 address is only for connections from outside Docker.

  5. 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.Http as the startup project and press F5. You can place breakpoints anywhere in the Tools/ 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

from github.com/charpz/mcp-data-gateway

Установка Data Gateway

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/charpz/mcp-data-gateway

FAQ

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-devавтор: wenb1n-dev

Postgres Server

This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools

madhurprashавтор: madhurprash

Postgres

Query your database in natural language

Anthropicавтор: Anthropic

PostgreSQL

Read-only database access with schema inspection.

modelcontextprotocolавтор: modelcontextprotocol

Redis

Interact with Redis key-value stores.

modelcontextprotocolавтор: modelcontextprotocol

SQLite

Database interaction and business intelligence capabilities.

modelcontextprotocolавтор: modelcontextprotocol

mxcp

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-labsавтор: raw-labs

tadas-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-githubавтор: tadas-github

julien040/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

julien040автор: julien040

drakonkat/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.

drakonkatавтор: drakonkat

Compare Data Gateway with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории data