Skip to main content
Glama

JitAPI

PyPI PyPI Downloads License: MIT Python 3.10+

让 Claude 指向任何 API。JitAPI 会自动计算出需要调用哪些端点以及调用的顺序。

JitAPI 是一个 MCP 服务器,允许 Claude 通过 OpenAPI 规范与任何 API 进行交互。JitAPI 不会将数百个端点一股脑塞进上下文,而是使用语义搜索和依赖图来仅呈现所需的内容——然后由 Claude 进行规划并执行调用。

https://github.com/user-attachments/assets/53f72f89-a41a-4a9c-a688-ec876ea05fbd


问题所在

Stripe 有 300 多个端点。GitHub 有 800 多个。将完整的规范加载到 Claude 的上下文中会浪费 Token 并导致幻觉。为每个使用的 API 编写自定义 MCP 服务器无法扩展。

JitAPI 解决了这个问题: 只需注册一次 OpenAPI 规范,然后用自然语言询问你需要什么。它会找到正确的端点,解析它们之间的依赖关系,并让 Claude 执行调用。

Related MCP server: OpenAPI to MCP

快速开始

pip install jitapi

添加到你的 Claude Code 配置 (.mcp.json) 中:

{
  "mcpServers": {
    "jitapi": {
      "command": "uvx",
      "args": ["jitapi"]
    }
  }
}

就是这样。无需 API 密钥——JitAPI 开箱即用,使用本地嵌入。

然后在 Claude 中:

You: Register the GitHub API from https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json

Claude: ✓ Registered GitHub v3 REST API — 1,107 endpoints indexed

You: List my repos

Claude: [searches for "list repositories for authenticated user" → finds GET /user/repos → executes]
Here are your repositories: ...

多 API 编排

杀手级功能:注册多个 API 并提出跨 API 的问题。JitAPI 会在所有已注册的 API 中进行搜索,Claude 会将调用串联起来。

You: Register the TMDB API and OpenWeatherMap API
Claude: ✓ Registered both APIs

You: Find the top popular movie on TMDB, then get the weather where it was filmed

Claude: [searches TMDB → GET /movie/popular → GET /movie/{id} for production locations
         → searches OpenWeather → GET /data/2.5/weather with the city]

The #1 popular movie is "Inception", filmed in Los Angeles.
Current weather in LA: 72°F, partly cloudy.

工作原理

Register API                          Ask a question
     │                                      │
     ▼                                      ▼
Parse OpenAPI spec               Embed query → vector search
     │                                      │
     ▼                                      ▼
Build dependency graph           Find relevant endpoints
     │                                      │
     ▼                                      ▼
Embed all endpoints              Expand with dependencies
     │                                      │
     ▼                                      ▼
Store in vector DB               Return schemas → Claude executes
  1. 注册 — 解析 OpenAPI 规范,构建依赖图(哪些端点需要来自其他端点的数据),并为所有端点创建可搜索的嵌入。

  2. 搜索 — 当你提出问题时,JitAPI 会对你的查询进行嵌入,并通过余弦相似度找到最相关的端点。

  3. 扩展 — 依赖图会添加任何先决条件端点(例如,“你需要先调用 GET /users 来获取 POST /orders 所需的 user_id”)。

  4. 执行 — Claude 获取端点模式并进行 API 调用,在步骤之间传递数据。

MCP 工具

工具

描述

register_api

从 OpenAPI 规范 URL 注册 API

list_apis

列出所有已注册的 API 及其端点数量

search_endpoints

使用自然语言在端点间进行语义搜索

get_workflow

通过依赖解析和完整模式查找相关端点

get_endpoint_schema

获取特定端点的完整模式

call_api

执行带有认证、路径参数、查询参数和主体的单个 API 调用

set_api_auth

配置认证(API 密钥、Bearer Token、基本认证)

delete_api

删除已注册的 API 及其所有数据

设置

Claude Code

在你的项目目录中创建 .mcp.json(或全局访问使用 ~/.claude.json):

{
  "mcpServers": {
    "jitapi": {
      "command": "uvx",
      "args": ["jitapi"]
    }
  }
}

Claude Desktop

添加到你的 Claude Desktop 配置中:

操作系统

配置文件路径

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Linux

~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "jitapi": {
      "command": "uvx",
      "args": ["jitapi"]
    }
  }
}

嵌入提供商

JitAPI 通过本地嵌入 (fastembed) 开箱即用——无需 API 密钥。为了在大型 API 上获得更好的搜索质量,你可以添加云嵌入提供商:

提供商

质量

设置

本地 (默认)

良好

无需操作——立即生效

Voyage AI (推荐)

优秀

pip install jitapi[voyage] + 设置 VOYAGE_API_KEY

OpenAI

优秀

pip install jitapi[openai] + 设置 OPENAI_API_KEY

Cohere

非常好

pip install jitapi[cohere] + 设置 COHERE_API_KEY

在你的 MCP 配置的 env 块中设置 API 密钥:

{
  "mcpServers": {
    "jitapi": {
      "command": "uvx",
      "args": ["jitapi"],
      "env": {
        "VOYAGE_API_KEY": "your-key-here"
      }
    }
  }
}

提供商会根据可用的环境变量自动检测。优先级:Voyage AI > OpenAI > Cohere > 本地。

认证

注册后配置 API 认证。推荐的方法是使用环境变量,这样密钥永远不会写入磁盘:

{
  "mcpServers": {
    "jitapi": {
      "command": "uvx",
      "args": ["jitapi"],
      "env": {
        "GITHUB_TOKEN": "ghp_...",
        "OPENWEATHER_API_KEY": "your-key-here"
      }
    }
  }
}

然后告诉 Claude 使用该环境变量:

You: Set bearer auth for GitHub using env var GITHUB_TOKEN
Claude: [calls set_api_auth with auth_type="bearer", env_var="GITHUB_TOKEN"]
✓ Auth configured for github (from env var $GITHUB_TOKEN)

使用 env_var 时,JitAPI 会在请求时从环境中读取密钥——只会持久化环境变量的名称,绝不会持久化凭据本身。

你也可以直接传递凭据(它们将以 0600 权限存储在 ~/.jitapi/auth.json 中):

You: Set API key auth for OpenWeather with param name "appid"
Claude: [calls set_api_auth with auth_type="api_key_query", credential="...", param_name="appid"]
✓ Auth configured for openweather

支持的认证类型:bearerapi_key_headerapi_key_querybasic

安全提示: 使用 env_var 时,凭据在运行时解析,绝不会触及文件系统。直接传递 credential 时,密钥会以明文 JSON 形式存储在 ~/.jitapi/auth.json 中(文件权限 0600,目录 0700)。在生产环境中使用时,请优先选择 env_var 方法。

环境变量

变量

必需

描述

VOYAGE_API_KEY

Voyage AI API 密钥(推荐的云提供商)

OPENAI_API_KEY

OpenAI API 密钥(替代云提供商)

COHERE_API_KEY

Cohere API 密钥(替代云提供商)

JITAPI_STORAGE_DIR

数据目录(默认:~/.jitapi

JITAPI_LOG_LEVEL

DEBUG, INFO, WARNING, ERROR(默认:INFO)

开发

git clone https://github.com/nk3750/jitapi.git
cd jitapi
pip install -e ".[dev]"
pytest
ruff check src/

许可证

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A standalone proxy that transforms any OpenAPI or Swagger-described REST API into an MCP server by mapping API operations to executable MCP tools. It enables AI clients to interact with existing web services through automated HTTP requests based on their official documentation.
    15
    16
    MIT
  • F
    license
    -
    quality
    -
    maintenance
    Universal AI API Orchestrator. 850 tools across 53 services under a single MCP interface. Connect Claude, GPT, or Gemini to Stripe, Slack, GitHub, LinkedIn, Cloudflare, Shopify, Twilio, and 46 more via natural language. $0.10/execution, no subscription. Patent Pending.
    500
    5
  • A
    license
    A
    quality
    C
    maintenance
    Turn any OpenAPI spec into MCP tools for Claude — instantly. Point mcp-openapi at any OpenAPI 3.x spec and Claude can call every endpoint through natural language. No custom integration code. No manual tool definitions. One line of config.
    2
    48
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Stripe-native marketplace where AI agents discover and pay per call for API services.

  • Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.

  • Universal AI API Orchestrator — 1,554 tools, 96 services. One install.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nk3750/jitapi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server