Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Data Gateway

FreeNot checked

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

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

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-gateway

FAQ

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

Compare 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