home / mcp / postgres mcp server

Postgres MCP Server

Provides a remote, authless MCP server on Cloudflare Workers and supports local clients via mcp-remote.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "alexandercohen-postgres-mcp": {
      "url": "https://remote-mcp-server-authless.<your-account>.workers.dev/sse"
    }
  }
}

You can host a remote MCP (Multi-Client Protocol) server that runs on Cloudflare Workers and connect to it from MCP clients or local tools. This setup allows you to expose your MCP capabilities without requiring authentication, making it convenient to try out tools and workflows from cloud and local environments.

How to use

Once your remote MCP server is deployed, you can connect to it from your MCP client or through local proxy tooling. Use the remote URL to access the server’s SSE endpoint and invoke the tools you’ve exposed in the init() method of your server code. You can also connect from Claude Desktop by pointing it at your local or remote MCP server via the provided configuration.

From an MCP client, point to the remote server URL and interact with the available tools. If you use a local proxy workflow, configure the client to forward requests to your local proxy URL (for example, http://localhost:8787/sse) or to your remote server’s SSE endpoint.

How to install

Prerequisites you need before starting:

  • Node.js (LTS version) with npm
  • Git (optional for cloning)

Create and deploy your remote MCP server to Cloudflare Workers using this command:

npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless

After running the command, your server will be available at a URL similar to remote-mcp-server-authless.<your-account>.workers.dev/sse. Open that URL in a browser or point your MCP client to it.

To customize the MCP server tools, edit the init() method in src/index.ts and add tools with this.server.tool(...). Then redeploy to apply changes.

If you want to test from the Cloudflare AI Playground or connect Claude Desktop, follow the guidance below for those workflows.

Additional content

Connect to Cloudflare AI Playground to interact with your remote MCP server directly from a browser-based client. Use the deployed server URL you created to access the tools and run tasks in a guided environment.

Connect Claude Desktop to your MCP server using the mcp-remote proxy by configuring Claude with the following example. This allows Claude to discover and use your remote tools through a simple proxy setup.

{
  "mcpServers": {
    "calculator": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse"  // or remote-mcp-server-authless.your-account.workers.dev/sse
      ]
    }
  }
}
Postgres MCP Server - alexandercohen/postgres-mcp