mcp server
mcp-rest-utils
Shared REST API utilities for building MCP servers
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 23, 2026MCP REST Utilities
Shared REST API utilities for building Model Context Protocol (MCP) servers.
Features
- RestClient: HTTP client with automatic retries, timeout handling, and error management
- RestToolFactory: Factory pattern for creating and executing MCP tools
- Type-safe configuration: TypeScript interfaces for REST tool definitions
- Error handling: Unified error handling across all servers
Installation
From GitHub
npm install git+https://github.com/munch-group/mcp-rest-utils.git
From source
git clone https://github.com/munch-group/mcp-rest-utils.git
cd mcp-rest-utils
npm install
npm run build
Usage
import { RestClient, RestToolFactory } from "@mcp/rest-utils";
// Create a REST client
const client = new RestClient({
baseUrl: "https://api.example.com",
defaultHeaders: { "Content-Type": "application/json" },
timeout: 30000,
retries: 3,
});
// Define tools
const tools = [{
name: "get_data",
description: "Get data from API",
method: "GET",
endpoint: (args) => `/data/${args.id}`,
inputSchema: { /* ... */ },
}];
// Create tool factory and execute
const factory = new RestToolFactory(client);
const result = await factory.executeTool(tools[0], { id: "123" });
Building
npm run build
License
ISC