Stdio-based MCP servers communicate through standard input/output (stdin/stdout) rather than HTTP endpoints. This approach is particularly useful for local development, testing, and scenarios where direct process communication is preferred.

Converting Stdio to HTTP with mcp-proxy and deploying as a TrueFoundry service

Since TrueFoundry AI Gateway requires HTTP endpoints, you’ll need to convert stdio servers to HTTP using mcp-proxy.

Installation

# TypeScript version (recommended)
npm install -g mcp-proxy

# Python version (alternative)
uv tool install mcp-proxy
# or
pipx install mcp-proxy
# or
uvx install mcp-proxy

Basic Usage

# Wrap any stdio-based MCP server command
mcp-proxy --port 8000 --host 0.0.0.0 --server stream --debug <your-stdio-command>

# Example with a Python server
mcp-proxy --port 8000 --host 0.0.0.0 --server stream python my-server.py

# Example with an npm package
mcp-proxy --port 8000 --host 0.0.0.0 --server stream npx my-mcp-server

Practical Examples

Example 1: Notion MCP Server

Complete setup for the Notion MCP server with proxy:
Local Development
# Install Notion MCP server
npm install -g @notionhq/notion-mcp-server

# Run directly as stdio server (for testing)
@notionhq/notion-mcp-server

# Run with proxy for HTTP access
mcp-proxy --port 8000 --host 0.0.0.0 --server stream @notionhq/notion-mcp-server

Example 2: Perplexity MCP Server

Search capabilities with real-time web research:
Local Setup
# Install Perplexity MCP server
npm install -g server-perplexity-ask

# Run with proxy
mcp-proxy --port 8000 --host 0.0.0.0 --server stream npx server-perplexity-ask

Deployment Templates

Node.js MCP Servers

type: service
name: nodejs-mcp-server
image:
  type: image
  image_uri: node:24
  command: npx -y mcp-proxy --port 8000 --host 0.0.0.0 --server stream npx your-mcp-server
ports:
  - port: 8000
    expose: false
    protocol: TCP
    app_protocol: http
env:
  NODE_ENV: production
  YOUR_API_KEY: "your_api_key_here"
replicas: 1
resources:
  cpu_request: 0.5
  cpu_limit: 1
  memory_request: 1000
  memory_limit: 2000

Python MCP Servers

type: service
name: python-mcp-server
image:
  type: image
  image_uri: python:3.11-slim
  command: >-
    sh -c "pip install mcp-proxy && mcp-proxy --port 8000 --host 0.0.0.0 python your-server.py"
ports:
  - port: 8000
    expose: false
    protocol: TCP
    app_protocol: http
env:
  PYTHONUNBUFFERED: "1"
  YOUR_API_KEY: "your_api_key_here"
replicas: 1
resources:
  cpu_request: 0.5
  cpu_limit: 1
  memory_request: 1000
  memory_limit: 2000