mcp-runner

by cookiecad

307 downloads Not rated yet

About

A TypeScript SDK for running MCP (Model Context Protocol) servers with process reuse capabilities

Explore

- Server process reuse across multiple calls
- Graceful termination with timeout handling
- Automatic server lifecycle management
- TypeScript support
- Error handling and logging

npm install

The package includes a command-line interface for interacting with MCP servers.

npm test

Lists all available tools for a specified MCP server:

npm run cli -- list-tools <server-name>

Example:

npm run cli -- list-tools sequential-thinking

npm run cli -- runserver sequential-thinking sequentialthinking '{"thought": "Initial thought", "thoughtNumber": 1, "totalThoughts": 5, "nextThoughtNeeded": true}'

npm run cli -- runserver sequential-thinking '{"thought": "Initial thought", "thoughtNumber": 1, "totalThoughts": 5, "nextThoughtNeeded": true}'

A TypeScript SDK and CLI for running MCP (Model Context Protocol) servers.

Overview

mcp-runner is designed to facilitate the execution of MCP servers based on configurations defined in cline_mcp_settings.json. It supports reusable server processes and controlled cleanup, allowing multiple operations to be performed using the same server instance.

You can call it from the command line or use it as a library in your own TypeScript projects or even from other MCP servers.

Features

- Server process reuse across multiple calls
- Graceful termination with timeout handling
- Automatic server lifecycle management
- TypeScript support
- Error handling and logging

Installation

npm install

CLI Usage

The package includes a command-line interface for interacting with MCP servers.

Commands

List Tools
Lists all available tools for a specified MCP server:
npm run cli -- list-tools <server-name>

Example:

npm run cli -- list-tools sequential-thinking

Run Server
Runs a specified MCP server with optional tool name and parameters: ```bash npm run cli -- runserver <server-name> [tool-name] [params] [options]
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.