AgentStack
MCP verified MIT Self-run

Mcp Tool Factory Ts

mcp-heshamfs-mcp-tool-factory-ts · by HeshamFS

Generate MCP servers from natural language, OpenAPI specs, or database schemas.

No reviews yet
0 installs
25 views
0.0% view→install

Install

$ agentstack add mcp-heshamfs-mcp-tool-factory-ts

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access Used
  • Shell / process execution Used
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README — it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-heshamfs-mcp-tool-factory-ts)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming — see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps — measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Tool Factory Ts? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

MCP Tool Factory (TypeScript)

Generate production-ready MCP (Model Context Protocol) servers from natural language descriptions, OpenAPI specs, database schemas, GraphQL schemas, or ontologies.

[](https://www.npmjs.com/package/@heshamfsalama/mcp-tool-factory) [](https://www.npmjs.com/package/@heshamfsalama/mcp-tool-factory) [](https://github.com/HeshamFS/mcp-tool-factory-ts/actions/workflows/ci.yml) [](https://opensource.org/licenses/MIT) [](https://www.typescriptlang.org/) [](https://nodejs.org/) [](https://registry.modelcontextprotocol.io)

Why MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect with external data sources and tools. MCP servers expose tools that can be used by:

  • Claude Code and Claude Desktop
  • OpenAI Agents SDK
  • Google ADK (Agent Development Kit)
  • LangChain and CrewAI
  • Any MCP-compatible client

MCP Tool Factory lets you generate complete, production-ready MCP servers in seconds.

Features

| Feature | Description | |---------|-------------| | Natural Language | Describe your tools in plain English | | OpenAPI Import | Convert any REST API spec to MCP tools | | Database CRUD | Generate tools from SQLite or PostgreSQL schemas | | GraphQL Import | Convert GraphQL schemas to MCP tools (queries to reads, mutations to writes) | | Ontology Import | Generate from RDF/OWL, JSON-LD, or YAML ontologies | | Resources & Prompts | Full support for all three MCP primitives: Tools, Resources, and Prompts | | 10 LLM Providers | Anthropic, OpenAI, Google, Mistral, DeepSeek, Groq, xAI, Azure, Cohere + Claude Code via Vercel AI SDK | | Cost Tracking | Per-call cost calculation, budget limits, provider cost comparison | | Parallel Generation | Tool implementations generated concurrently for faster output | | LLM Response Caching | Deduplicates identical LLM calls with configurable TTL | | Streamable HTTP | Generated servers use the modern Streamable HTTP transport | | Web Search | Auto-fetch API documentation for better generation | | Production Ready | Logging, metrics, rate limiting, retries built-in | | Type Safe | Full TypeScript with strict mode | | MCP Registry | Generates server.json for registry publishing | | Is an MCP Server | Use it directly with Claude to generate servers on-the-fly |

Use as MCP Server

MCP Tool Factory is itself an MCP server! Add it to Claude Desktop, Claude Code, Cursor, or VS Code to generate MCP servers through conversation.

Tier 1 — Zero Config (Claude Code)

Claude Code auto-injects CLAUDE_CODE_OAUTH_TOKEN — no env vars needed:

claude mcp add mcp-tool-factory -- node /path/to/mcp-tool-factory-ts/bin/mcp-server.js

Tier 2 — Standard (Pick a Provider)

Set one API key and go. The factory auto-detects the provider:

Claude Desktop / Cursor / VS Code — add to your MCP config (claude_desktop_config.json, .cursor/mcp.json, or .vscode/mcp.json):

{
  "mcpServers": {
    "mcp-tool-factory": {
      "command": "node",
      "args": ["/path/to/mcp-tool-factory-ts/bin/mcp-server.js"],
      "env": {
        "ANTHROPIC_API_KEY": "your-key-here"
      }
    }
  }
}

Any of these API keys will work: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY, DEEPSEEK_API_KEY, GROQ_API_KEY, XAI_API_KEY, AZURE_OPENAI_API_KEY, COHERE_API_KEY.

Tier 3 — Full Control (Provider + Model + Budget)

Use MCP_FACTORY_PROVIDER, MCP_FACTORY_MODEL, and MCP_FACTORY_BUDGET to override auto-detection:

{
  "mcpServers": {
    "mcp-tool-factory": {
      "command": "node",
      "args": ["/path/to/mcp-tool-factory-ts/bin/mcp-server.js"],
      "env": {
        "OPENAI_API_KEY": "your-key-here",
        "MCP_FACTORY_PROVIDER": "openai",
        "MCP_FACTORY_MODEL": "gpt-5.2",
        "MCP_FACTORY_BUDGET": "0.50"
      }
    }
  }
}

| Env Var | Purpose | Example | |---------|---------|---------| | MCP_FACTORY_PROVIDER | Override auto-detected provider | openai, groq, deepseek | | MCP_FACTORY_MODEL | Override default model | gpt-5.2, deepseek-chat | | MCP_FACTORY_BUDGET | Per-generation budget limit in USD | 0.50 |

Claude Code CLI with full control:

claude mcp add mcp-tool-factory \
  -e DEEPSEEK_API_KEY=your-key \
  -e MCP_FACTORY_PROVIDER=deepseek \
  -e MCP_FACTORY_MODEL=deepseek-chat \
  -e MCP_FACTORY_BUDGET=0.25 \
  -- node /path/to/mcp-tool-factory-ts/bin/mcp-server.js

Available Tools

| Tool | Description | |------|-------------| | generate_mcp_server | Generate from natural language description | | generate_from_openapi | Generate from OpenAPI specification | | generate_from_database | Generate from database schema | | generate_from_graphql | Generate from GraphQL schema | | generate_from_ontology | Generate from RDF/OWL, JSON-LD, or YAML ontology | | validate_typescript | Validate TypeScript code | | list_providers | List available LLM providers | | get_factory_info | Get factory capabilities |

Example Conversation

> You: Create an MCP server for the GitHub API with tools to list repos, create issues, and manage pull requests > > Claude: Uses generate_mcp_server tool > > I've generated a complete MCP server with the following tools: > - list_repositories - List user repositories > - create_issue - Create a new issue > - list_pull_requests - List PRs for a repo > - merge_pull_request - Merge a PR > > Let me write these files to your project...

Quick Start

Installation

# Global installation
npm install -g @heshamfsalama/mcp-tool-factory

# Or use npx
npx @heshamfsalama/mcp-tool-factory generate "Create tools for managing a todo list"

Set Your API Key

At least one provider API key is required:

# Anthropic Claude (recommended)
export ANTHROPIC_API_KEY=your-key-here

# Or Claude Code OAuth
export CLAUDE_CODE_OAUTH_TOKEN=your-token-here

# Or any other supported provider
export OPENAI_API_KEY=your-key-here
export GOOGLE_API_KEY=your-key-here
export MISTRAL_API_KEY=your-key-here
export DEEPSEEK_API_KEY=your-key-here
export GROQ_API_KEY=your-key-here
export XAI_API_KEY=your-key-here
export AZURE_OPENAI_API_KEY=your-key-here
export COHERE_API_KEY=your-key-here

Generate Your First Server

# From natural language
mcp-factory generate "Create tools for fetching weather data by city and converting temperatures"

# From OpenAPI spec
mcp-factory from-openapi ./api-spec.yaml

# From database
mcp-factory from-database ./data.db

# From GraphQL schema
mcp-factory from-graphql ./schema.graphql

# From ontology
mcp-factory from-ontology ./ontology.owl --format rdf

Usage

Natural Language Generation

mcp-factory generate "Create tools for managing a todo list with priorities" \
  --name todo-server \
  --output ./servers/todo \
  --web-search \
  --logging \
  --metrics

OpenAPI Specification

# From local file
mcp-factory from-openapi ./openapi.yaml --name my-api-server

# With custom base URL
mcp-factory from-openapi ./spec.json --base-url https://api.example.com

Database Schema

# SQLite
mcp-factory from-database ./myapp.db --tables users,posts,comments

# PostgreSQL
mcp-factory from-database "postgresql://user:pass@localhost/mydb" --type postgresql

GraphQL Schema

# From a GraphQL SDL file
mcp-factory from-graphql ./schema.graphql --name my-graphql-server

# From a URL endpoint
mcp-factory from-graphql https://api.example.com/graphql --name my-api-server

GraphQL queries are mapped to read-only MCP tools, and mutations are mapped to write tools. GraphQL types are automatically converted to Zod validation schemas.

Ontology

# From RDF/OWL (.owl, .rdf, .ttl)
mcp-factory from-ontology ./ontology.owl --format rdf --name knowledge-server

# From JSON-LD (.jsonld)
mcp-factory from-ontology ./schema.jsonld --format jsonld --name linked-data-server

# From custom YAML ontology
mcp-factory from-ontology ./domain.yaml --format yaml --name domain-server

OWL Classes are mapped to MCP Resources, ObjectProperties become Tools, and DataProperties become tool parameters.

Test & Serve

# Run tests
mcp-factory test ./servers/my-server

# Start server for testing
mcp-factory serve ./servers/my-server

Generated Server Structure

servers/my-server/
├── src/
│   └── index.ts          # MCP server with tools, resources, and prompts
├── tests/
│   └── tools.test.ts     # Vitest tests (InMemoryTransport)
├── package.json          # Dependencies
├── tsconfig.json         # TypeScript config
├── Dockerfile            # Container deployment
├── README.md             # Usage documentation
├── skill.md              # Claude Code skill file
├── server.json           # MCP Registry manifest
├── EXECUTION_LOG.md      # Generation trace (optional)
└── .github/
    └── workflows/
        └── ci.yml        # GitHub Actions CI/CD

Generated servers export a createServer() factory function for easy testing. The server uses Streamable HTTP transport with a single /mcp POST endpoint and a /health GET endpoint. Tests use InMemoryTransport.createLinkedPair() for fast, reliable in-process testing with vitest.

CLI Reference

| Command | Description | |---------|-------------| | generate | Generate MCP server from natural language | | from-openapi | Generate from OpenAPI specification | | from-database | Generate from database schema | | from-graphql | Generate from GraphQL schema | | from-ontology | Generate from RDF/OWL, JSON-LD, or YAML ontology | | test | Run tests for generated server | | serve | Start server for testing | | info | Display factory information |

Generate Options

mcp-factory generate "..." \
  --output, -o            # Output directory (default: ./servers)
  --name, -n              # Server name
  --description, -d       # Package description
  --github-username, -g   # GitHub username for MCP Registry
  --version, -v            # Server version (default: 1.0.0)
  --provider, -p      # LLM provider (anthropic, openai, google, mistral, deepseek, groq, xai, azure, cohere, claude_code)
  --model, -m            # Specific model to use
  --web-search, -w              # Search web for API documentation
  --auth               # Environment variables for auth
  --health-check                # Include health check endpoint (default: true)
  --logging                     # Enable structured logging (default: true)
  --metrics                     # Enable Prometheus metrics
  --rate-limit               # Rate limiting (requests per minute)
  --retries                     # Enable retry logic (default: true)
  --budget              # Maximum spend in USD (aborts if exceeded)
  --compare-costs               # Show cost comparison across providers before generating

Configuration

Environment Variables

| Variable | Description | Required | |----------|-------------|----------| | ANTHROPIC_API_KEY | Anthropic Claude API key | At least one | | CLAUDE_CODE_OAUTH_TOKEN | Claude Code OAuth token | provider key | | OPENAI_API_KEY | OpenAI API key | is required | | GOOGLE_API_KEY | Google Gemini API key | for generation | | MISTRAL_API_KEY | Mistral AI API key | | | DEEPSEEK_API_KEY | DeepSeek API key | | | GROQ_API_KEY | Groq API key | | | XAI_API_KEY | xAI Grok API key | | | AZURE_OPENAI_API_KEY | Azure OpenAI API key | | | COHERE_API_KEY | Cohere API key | |

LLM Providers

All providers use the Vercel AI SDK via a unified UnifiedLLMProvider class with lazy dynamic imports — only the @ai-sdk/* package for your chosen provider is loaded at runtime.

| Provider | Models | Best For | |----------|--------|----------| | Anthropic | claude-opus-4-6, claude-sonnet-4-5, claude-haiku-4-5 | Highest quality | | OpenAI | gpt-5.2, gpt-5.2-codex, o3, o4-mini | Fast generation | | Google | gemini-3-pro, gemini-3-flash, gemini-2.5-pro | Cost effective | | Mistral | mistral-large, codestral, magistral | European AI, code | | DeepSeek | deepseek-chat, deepseek-reasoner | Ultra low cost | | Groq | llama-3.3-70b, llama-4-maverick | Ultra-fast inference | | xAI | grok-4, grok-3, grok-code-fast | Reasoning | | Azure | gpt-4o (Azure-hosted) | Enterprise compliance | | Cohere | command-a, command-r+ | RAG, enterprise search | | Claude Code | claude-sonnet-4-5 (OAuth) | Claude Code users |

Programmatic Usage

Basic Usage

import { ToolFactoryAgent, writeServerToDirectory, formatCost } from '@heshamfsalama/mcp-tool-factory';

// Create agent (auto-detects provider from env vars)
const agent = new ToolFactoryAgent();

// Generate from description
const server = await agent.generateFromDescription(
  'Create tools for managing a todo list with priorities',
  {
    serverName: 'todo-server',
    webSearch: true,
    parallel: true,           // Enable parallel generation (default)
    maxConcurrency: 5,        // Max concurrent LLM calls (default)
    budget: 1.00,             // Optional: abort if cost exceeds $1.00
    productionConfig: {
      enableLogging: true,
      enableMetrics: true,
    },
  }
);

// Cost tracking — see how much the generation cost
if (server.executionLog) {
  console.log(`Cost: ${formatCost(server.executionLog.totalCost)}`);
}

// Write to directory
await writeServerToDirectory(server, './servers/todo');

From OpenAPI

import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';
import yaml from 'js-yaml';

const spec = yaml.load(readFileSync('./openapi.yaml', 'utf-8'));
const agent = new ToolFactoryAgent({ requireLlm: false });

const server = await agent.generateFromOpenAPI(spec, {
  serverName: 'my-api-server',
  baseUrl: 'https://api.example.com',
});

await writeServerToDirectory(server, './servers/api');

From Database

import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';

const agent = new ToolFactoryAgent({ requireLlm: false });

// SQLite (auto-detected from file path)
const server = await agent.generateFromDatabase('./data/app.db', {
  serverName: 'app-database-server',
  tables: ['users', 'posts', 'comments'],
});

// PostgreSQL (auto-detected from connection string)
const pgServer = await agent.generateFromDatabase(
  'postgresql://user:pass@localhost/mydb',
  { serverName: 'postgres-server' }
);

await writeServerToDirectory(server, './servers/app-db');

From GraphQL

import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';

const schema = readFileSync('./schema.graphql', 'utf-8');
const agent = new ToolFactoryAgent({ requireLlm: false });

const server = await agent.generateFromGraphQL(schema, {
  serverName: 'my-graphql-server',
});

await writeServerToDirectory(server, './servers/graphql');

From Ontology

import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';

const ontologyData = readFileSync('./ontology.owl', 'utf-8');
const agent = new ToolFactoryAgent({ requireLlm: false });

const server = await agent.generateFromOntology(ontologyData, {
  serverName: 'knowledge-server',
  format: 'rdf',
});

await writeServerToDirectory(server, './servers/knowledge');

Code Validation

import { validateTypeScriptCode, validateGeneratedServer } from '@heshamfsalama/mcp-tool-factory';

// Validate TypeScript syntax
const result = await validateTypeScriptCode(code);
// { valid: false, errors: [{ line: 4, column: 1, message: "'}' expected." }] }

// Validate complete server
const serverResult = await validateGeneratedServer(serverCode);
// { val

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [HeshamFS](https://github.com/HeshamFS)
- **Source:** [HeshamFS/mcp-tool-factory-ts](https://github.com/HeshamFS/mcp-tool-factory-ts)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/@heshamfsalama/mcp-tool-factory

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.