Skip to content

Latest commit

 

History

History
138 lines (117 loc) · 2.69 KB

File metadata and controls

138 lines (117 loc) · 2.69 KB

MCP Registry API Documentation

This API provides access to the Model Context Protocol (MCP) Registry.

Setup

Local Development

  1. Install dependencies:
npm install
  1. Run the server:
# Development mode with auto-reload
npm run dev

# Production mode
npm start

Docker Deployment

  1. Build the Docker image:
docker build -t mcp-registry .
  1. Run the container:
# Run in detached mode
docker run -d -p 3000:3000 --name mcp-registry mcp-registry

# Run with interactive output
docker run -it -p 3000:3000 --name mcp-registry mcp-registry
  1. Stop the container:
docker stop mcp-registry

The server will start at http://localhost:3000

API Endpoints & Example Usage

1. Welcome Endpoint (GET /)

curl http://localhost:3000/

Response:

{
    "message": "Welcome to MCP Registry API"
}

2. Get All Registry Items (GET /registry)

curl http://localhost:3000/registry

Response:

{
    "fetch": {
        "description": "HTTP request server for making external API calls",
        "command": "uvx",
        "args": ["mcp-server-fetch"],
        "type": "stdio",
        "parameters": {}
    },
    "memory": {
        "description": "Memory management server for conversation history",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-memory"],
        "type": "stdio",
        "parameters": {}
    }
    // ... other items
}

3. Get Specific MCP Configuration (GET /registry/{name})

# Get fetch configuration
curl http://localhost:3000/registry/fetch

Response:

{
    "name": "fetch",
    "config": {
        "description": "HTTP request server for making external API calls",
        "command": "uvx",
        "args": ["mcp-server-fetch"],
        "type": "stdio",
        "parameters": {}
    }
}

4. Search Registry (GET /search)

# Search for memory-related servers
curl "http://localhost:3000/search?q=memory"

# Search by server type
curl "http://localhost:3000/search?q=server"

Response example:

{
    "memory": {
        "description": "Memory management server for conversation history",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-memory"],
        "type": "stdio",
        "parameters": {}
    }
}

Testing All Endpoints

Here's a complete test script:

# Test welcome endpoint
echo "Testing welcome endpoint:"
curl http://localhost:3000/

echo -e "\n\nTesting full registry:"
curl http://localhost:3000/registry

echo -e "\n\nTesting specific item (fetch):"
curl http://localhost:3000/registry/fetch

echo -e "\n\nTesting search (memory):"
curl "http://localhost:3000/search?q=memory"