POST
/
v1
/
build
curl -X POST https://api.leanmcp.com/v1/build \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "email-assistant",
    "template": "basic",
    "tools": [
      {
        "name": "send_email",
        "description": "Send an email to someone",
        "inputSchema": {
          "type": "object", 
          "properties": {
            "to": {"type": "string"},
            "subject": {"type": "string"},
            "body": {"type": "string"}
          },
          "required": ["to", "subject", "body"]
        }
      }
    ],
    "resources": [
      {
        "uri": "user://contacts",
        "name": "User Contacts",
        "description": "List of user contact information",
        "mimeType": "application/json"
      }
    ]
  }'
{
  "success": true,
  "data": {
    "mcp_id": "mcp_abc123def456",
    "name": "email-assistant", 
    "status": "ready",
    "url": "https://mcp-abc123def456.leanmcp.com",
    "build_time": 8.5
  },
  "meta": {
    "request_id": "req_789xyz",
    "timestamp": "2023-12-01T12:00:00Z"
  }
}
Build a new MCP server with your tools, resources, and prompts.

Request

name
string
required
Name of your MCP server
template
string
required
Template to use. Options: basic, advanced, custom
tools
array
Array of tools your MCP provides
resources
array
Array of resources your MCP provides
prompts
array
Array of prompt templates your MCP provides

Response

success
boolean
Whether the build succeeded
data
object
curl -X POST https://api.leanmcp.com/v1/build \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "email-assistant",
    "template": "basic",
    "tools": [
      {
        "name": "send_email",
        "description": "Send an email to someone",
        "inputSchema": {
          "type": "object", 
          "properties": {
            "to": {"type": "string"},
            "subject": {"type": "string"},
            "body": {"type": "string"}
          },
          "required": ["to", "subject", "body"]
        }
      }
    ],
    "resources": [
      {
        "uri": "user://contacts",
        "name": "User Contacts",
        "description": "List of user contact information",
        "mimeType": "application/json"
      }
    ]
  }'
{
  "success": true,
  "data": {
    "mcp_id": "mcp_abc123def456",
    "name": "email-assistant", 
    "status": "ready",
    "url": "https://mcp-abc123def456.leanmcp.com",
    "build_time": 8.5
  },
  "meta": {
    "request_id": "req_789xyz",
    "timestamp": "2023-12-01T12:00:00Z"
  }
}

Common Use Cases

Simple Tool MCP

Build an MCP with just tools (no resources or prompts):
{
  "name": "calculator",
  "template": "basic",
  "tools": [
    {
      "name": "add",
      "description": "Add two numbers together",
      "inputSchema": {
        "type": "object",
        "properties": {
          "a": {"type": "number"},
          "b": {"type": "number"}
        }
      }
    }
  ]
}

Data Access MCP

Build an MCP that gives AI access to your data:
{
  "name": "user-data",
  "template": "basic", 
  "resources": [
    {
      "uri": "user://profile",
      "name": "User Profile",
      "description": "Current user profile information"
    },
    {
      "uri": "user://settings", 
      "name": "User Settings",
      "description": "User application settings"
    }
  ]
}