← All procedures

mcp.serve

Start MCP server to expose procedures as tools

Package
@procedures/mcp-server · README
Path
["mcp","serve"]
CLI
Not a mark command: its package does not declare client.procedures.
As data
{"$proc":["mcp","serve"],"input":{}}
Tags
mcp, server

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/mcp-server"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["mcp","serve"], {});
console.log(JSON.stringify(result));

As data, in a program

{ "$proc": ["mcp", "serve"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
transport"stdio"no"stdio"Transport type (default: "stdio"). Only stdio is implemented: the SSE transport needs an HTTP server integration, and accepting "sse" here only led to an error (BUGS-2026-07 L28).
namestringnoServer name for MCP (default: "procedure-server")
versionstringnoServer version for MCP (default: "1.0.0")
autoRegisterbooleannotrueWhether to auto-register all procedures (default: true)
debugbooleannofalseEnable debug logging
namespacesstring[]noThe namespaces (first path segments) of the tools. With this list, the bundles give no tools.
excludestring[]noProcedure keys of the tool namespaces that are not tools.
bundlesstring[]noThe bundles whose mcpNamespaces and mcpExclude give the tools, when `namespaces` is not given.
strictCallsbooleannotrueTrue (the default): a procedure of code without metadata.calls can call only tools.
toolTimeoutMsintegerno600000The time limit of each tool call, in milliseconds (default: 600000). 0: no limit.

Output

The schema does not list fields (object).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "transport": {
        "default": "stdio",
        "description": "Transport type (default: \"stdio\"). Only stdio is implemented: the SSE transport needs an HTTP server integration, and accepting \"sse\" here only led to an error (BUGS-2026-07 L28).",
        "type": "string",
        "enum": [
          "stdio"
        ]
      },
      "name": {
        "description": "Server name for MCP (default: \"procedure-server\")",
        "type": "string"
      },
      "version": {
        "description": "Server version for MCP (default: \"1.0.0\")",
        "type": "string"
      },
      "autoRegister": {
        "default": true,
        "description": "Whether to auto-register all procedures (default: true)",
        "type": "boolean"
      },
      "debug": {
        "default": false,
        "description": "Enable debug logging",
        "type": "boolean"
      },
      "namespaces": {
        "description": "The namespaces (first path segments) of the tools. With this list, the bundles give no tools.",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "exclude": {
        "description": "Procedure keys of the tool namespaces that are not tools.",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "bundles": {
        "description": "The bundles whose mcpNamespaces and mcpExclude give the tools, when `namespaces` is not given.",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "strictCalls": {
        "default": true,
        "description": "True (the default): a procedure of code without metadata.calls can call only tools.",
        "type": "boolean"
      },
      "toolTimeoutMs": {
        "default": 600000,
        "description": "The time limit of each tool call, in milliseconds (default: 600000). 0: no limit.",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      }
    }
  },
  "output": {
    "type": "object"
  }
}