Skip to main content
Glama
callmybot

cookbook-mcp-server

by callmybot

TypeScript MCP Server with Custom Container

A simple TypeScript MCP server built using the official MCP TypeScript SDK, Express, and custom Docker container. This example demonstrates how you can host HTTP servers on Smithery using custom containers, with STDIO support for backwards compatibility.

See the complete guide: https://smithery.ai/docs/migrations/typescript-custom-container

Try it live on Smithery

Features:

  • CORS: CORS headers for browser-based MCP clients

  • Smithery Session Configuration: handles user's session configuration passed via Smithery (learn more)

  • Request Logging Middleware: Custom middleware for debugging HTTP requests and responses

  • Server Transport: Can run with both STDIO and HTTP transports using TRANSPORT env variable

Related MCP server: MCP TypeScript Starter

Prerequisites

  • Node.js 22 or higher

  • npm package manager

Project Structure

  • src/index.ts - Main Express server with MCP HTTP transport

  • package.json - Node.js dependencies and scripts

  • smithery.yaml - Smithery deployment and session configuration

  • Dockerfile - Dockerfile to host server in Smithery

Quick Start

  1. Install dependencies:

    npm install
  2. Run the development server:

    HTTP Mode:

    npm run dev

    This will start the server on port 8081.

  3. Test interactively: Once your server is running in HTTP mode, you can test it interactively using the Smithery playground:

    npx -y @smithery/cli playground --port 8081
  4. Deploy your own version: To deploy your own MCP server:

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A demonstration MCP server built in TypeScript that shows how to implement stdio-based communication for integration with MCP clients. Serves as a template for building custom MCP servers with strong typing and maintainability.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides a starting template for building MCP servers with TypeScript, including examples of tools and resources to accelerate development.
    -
  • F
    license
    C
    quality
    C
    maintenance
    A TypeScript template for building MCP servers with placeholder tools and dual transport support (stdio + SSE).
    5
    -