@spec2tools/stdio-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Spec2Tools
Dynamically convert OpenAPI specs into AI agent tools at runtime—no code generation required.
Packages
This monorepo contains four packages:
Package | Description | Install |
Core utilities for OpenAPI parsing and authentication |
| |
Create AI SDK tools from OpenAPI specifications |
| |
CLI for interacting with OpenAPI-based AI tools |
| |
MCP server exposing OpenAPI endpoints as tools via stdio |
|
Related MCP server: OpenAPI MCP Server
Quick Start
Using the SDK
import { createTools } from '@spec2tools/sdk';
import { generateText, stepCountIs } from 'ai';
import { openai } from '@ai-sdk/openai';
const tools = await createTools({ spec: './openapi.yaml' });
const result = await generateText({
model: openai('gpt-4o'),
tools,
prompt: 'List all users',
stopWhen: stepCountIs(3)
});
console.log(result.text);Using the CLI
# Set your OpenAI API key
export OPENAI_API_KEY=your-api-key
# Start the agent with an OpenAPI spec
npx @spec2tools/cli start --spec https://api.example.com/openapi.jsonUsing as MCP Server
# Add to Claude Code (or any MCP client)
claude mcp add --transport stdio my-api \
-- npx @spec2tools/stdio-mcp ./path/to/openapi.yamlCode Mode
Collapse all API endpoints into just 2 tools (search + execute), cutting input token usage by ~99.9%:
# MCP server with code mode
claude mcp add --transport stdio my-api \
-- npx @spec2tools/stdio-mcp ./openapi.yaml --code-mode// SDK with code mode
const tools = await createTools({
spec: './openapi.yaml',
codeMode: true,
});You can also convert any existing AI SDK tools to code mode:
import { toCodeModeTools } from '@spec2tools/core';
const codeModeTools = toCodeModeTools(existingTools);Thesis
You have a server. You have an OpenAPI spec. Now, with all the MCP hype, you're told you need to build another server—an MCP server—just so AI agents can call your API. You look it up: define tools, maintain handlers, keep it in sync with your actual API. But wait... you already described your API in OpenAPI. Why do we need to describe it to the agent twice?
Spec2Tools is the alternative. It reads your OpenAPI spec and exposes endpoints as tools—no code generation, no maintenance burden. Use it directly with the AI SDK, or spin up an MCP server instantly from your existing spec.
Development
# Clone the repo
git clone https://github.com/CahidArda/spec2tools.git
cd spec2tools
# Install dependencies
pnpm install
# Build all packages
pnpm buildLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceTurn any OpenAPI/Swagger spec into MCP tools. Zero config, zero code. Supports Swagger 2.0, OpenAPI 3.x, Bearer/API-key/OAuth2 auth, flat parameter schemas for better LLM accuracy, and smart response truncation.379 npm3MIT
- FlicenseNot gradedqualityDmaintenanceDynamically exposes any OpenAPI/Swagger API as tools for AI assistants, automatically generating MCP tools from OpenAPI specs with authentication support.-
- AlicenseNot gradedqualityDmaintenanceConverts an OpenAPI spec into an MCP server, enabling AI agents to call your API without writing tool definitions or integration code.3MIT
- AlicenseNot gradedqualityCmaintenanceConverts any OpenAPI 3.x spec into a live MCP server, making every endpoint a validated tool that AI agents can call without writing glue code.9 npmMIT