Skip to main content

@cuple/mcp

Functions​

createMcpServer()​

createMcpServer(filePath, variableName, options): Server<{ }, { }, {[key: string]: unknown; }>

Defined in: index.ts:122

The MCP server serveMcp runs, not yet connected: for another transport, or a test.

Calls go through the RPC endpoint rather than the REST path, so routes without .path() are tools too.

Parameters​

filePath​

string

variableName​

string

options​

McpOptions

Returns​

Server<{ }, { }, {[key: string]: unknown; }>


routeToTool()​

routeToTool(route): object

Defined in: index.ts:70

One tool per route: its name, .meta({ description }) and inputs.

Parameters​

route​

RouteInfo

Returns​

object


serveMcp()​

serveMcp(filePath, variableName, options): Promise<Server<{ }, { }, {[key: string]: unknown; }>>

Defined in: index.ts:105

Serves your routes as MCP tools over stdio, the way agents start a local MCP server:

serveMcp("./src/routes.ts", "routes", { url: "http://localhost:8080/rpc" });

variableName is the exported variable that holds your routes, as for generateOpenAPI.

Parameters​

filePath​

string

variableName​

string

options​

McpOptions

Returns​

Promise<Server<{ }, { }, {[key: string]: unknown; }>>

Type Aliases​

McpOptions​

McpOptions = object

Defined in: index.ts:19

Properties​

name?​

optional name?: string

Defined in: index.ts:25

How the server introduces itself to the agent. Default: "cuple".

tsconfigPath?​

optional tsconfigPath?: string

Defined in: index.ts:23

Defaults to the nearest tsconfig.json.

url​

url: string

Defined in: index.ts:21

Your server's RPC endpoint, e.g. http://localhost:8080/rpc.

version?​

optional version?: string

Defined in: index.ts:26