AI Context MCP
Provides real-time, version-pinned documentation from 57+ AI/ML libraries to LLMs, preventing hallucinated APIs by fetching current docs and changelogs directly from GitHub.
README
<p align="center"> <img src="assets/logo.svg" alt="AI Context MCP" width="400"/> </p>
<p align="center"> <a href="https://www.npmjs.com/package/ai-context-mcp"><img src="https://img.shields.io/npm/v/ai-context-mcp?style=flat-square&color=6366f1&label=npm" alt="npm version"/></a> <a href="https://www.npmjs.com/package/ai-context-mcp"><img src="https://img.shields.io/npm/dm/ai-context-mcp?style=flat-square&color=8b5cf6&label=downloads" alt="npm downloads"/></a> <a href="https://github.com/Prathmeshkunturwar/Context_Mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License"/></a> <a href="https://github.com/Prathmeshkunturwar/Context_Mcp/actions"><img src="https://img.shields.io/github/actions/workflow/status/Prathmeshkunturwar/Context_Mcp/ci.yml?style=flat-square&label=CI&color=22c55e" alt="CI"/></a> <a href="https://github.com/Prathmeshkunturwar/Context_Mcp/blob/main/TESTING.md"><img src="https://img.shields.io/badge/tests-39%20passing-22c55e?style=flat-square" alt="Tests"/></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen?style=flat-square" alt="Node.js"/></a> </p>
<p align="center"> <strong>Give your LLM real-time, version-pinned documentation instead of hallucinated APIs.</strong><br/> An MCP server that injects live docs from <strong>57+ AI/ML libraries</strong> directly into Claude, Cursor, or any MCP-compatible client. </p>
<p align="center"> 🚫 No outdated training data · ✅ Zero telemetry · 📦 Fully local · ⚡ SQLite offline cache </p>
Table of Contents
- Why AI Context MCP?
- Quick Start
- Setup
- Environment Variables
- Tools Reference
- Supported Libraries
- Architecture
- Contributing
- Troubleshooting
- License
Why AI Context MCP?
LLMs are trained on static snapshots of the web. By the time you use Claude or Cursor, its knowledge of langchain, openai, pytorch etc. is already months out of date — causing:
- ❌ Hallucinated function signatures that don't exist
- ❌ Deprecated patterns the model confidently recommends
- ❌ Silent breaking changes that crash your app at runtime
AI Context MCP solves this by fetching current docs and changelogs from GitHub at query time, ranking them semantically, and injecting them into the model's context window.
Quick Start
Option 1 — NPM Global Install (recommended)
npm install -g ai-context-mcp
Option 2 — Clone & Build
git clone https://github.com/Prathmeshkunturwar/Context_Mcp.git
cd Context_Mcp
npm install && npm run build
Setup
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["-y", "ai-context-mcp"],
"env": { "GITHUB_TOKEN": "ghp_your_token_here" }
}
}
}
Claude Desktop
Edit claude_desktop_config.json:
| OS | Path |
|---|---|
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["-y", "ai-context-mcp"],
"env": { "GITHUB_TOKEN": "ghp_your_token_here" }
}
}
}
Cursor / Other MCP Clients
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["-y", "ai-context-mcp"],
"env": { "GITHUB_TOKEN": "ghp_your_token_here" }
}
}
}
Environment Variables
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Recommended | GitHub PAT. Without it: 60 req/hr. With it: 5,000/hr. Create one (no scopes needed). |
TRANSPORT |
Optional | Set to http for Express HTTP server instead of stdio. |
CACHE_TTL_HOURS |
Optional | Cache TTL in hours (default: 24). |
PORT |
Optional | HTTP port when TRANSPORT=http (default: 3000). |
Tools Reference
resolve-library-id
Maps natural language to a registry library ID.
"LangChain JavaScript" → /langchain-ai/langchainjs
query-docs
Fetches version-pinned documentation snippets, semantically ranked using MiniLM-L6.
query-docs(libraryId: "/openai/openai-python", query: "streaming", version: "1.0.0")
get-changelog-diff
Extracts breaking changes and new features between two versions.
get-changelog-diff(libraryId: "/langchain-ai/langchainjs", fromVersion: "0.1.0", toVersion: "0.3.0")
→ 7 BREAKING CHANGES, 12 NEW FEATURES
get-source-signature
Extracts raw type/function/class signatures directly from source code.
get-source-signature(libraryId: "/langchain-ai/langchainjs", filePath: "...", entityName: "RunnableSequence")
detect-project-versions
Scans your local package.json or requirements.txt to detect installed library versions.
detect-project-versions(projectPath: "./")
→ { "langchain": "0.1.0", "@langchain/openai": "0.0.14" }
auto-migrate-codebase
Analyzes your codebase against changelog breaking changes and generates migration alerts.
auto-migrate-codebase(libraryId: "...", projectPath: "./", fromVersion: "0.1.0", toVersion: "0.3.0")
suggest-skills
Scans your project imports and recommends which libraries to look up.
suggest-skills(projectPath: "./") → ["/langchain-ai/langchainjs", "/openai/openai-node"]
Supported Libraries
🤖 LLM Provider SDKs
OpenAI Python · OpenAI Node.js · Anthropic Python · Anthropic TypeScript · Google Generative AI · Mistral AI · Cohere
🦾 Agent Frameworks
LangChain Python · LangChain.js · LangGraph · LlamaIndex · CrewAI · Pydantic AI · AutoGen · Letta (MemGPT) · Vercel AI SDK
🧠 ML Frameworks
PyTorch · HuggingFace Transformers · Diffusers · Accelerate · PEFT · Pydantic
⚡ Inference Engines
vLLM · llama.cpp · Ollama
🗄️ Vector Databases
ChromaDB · Qdrant · Pinecone · Weaviate
🌐 Web Frameworks
React · Next.js · Vue · Nuxt · Svelte · SvelteKit · Express · Fastify · Hono
🗃️ Database & ORM
Prisma · Drizzle · TypeORM · Mongoose
🔌 API & Validation
tRPC · Zod · Apollo Server
🧪 Testing & Infrastructure
Vitest · Playwright · Supabase JS · Firebase JS
57 libraries and growing! Run
npm run add-libraryor open a PR to add yours.
Architecture
┌─────────────────────────────────────────────────────────┐
│ MCP Client (Claude / Cursor) │
│ resolve → query → changelog → signature │
└───────────────────────┬─────────────────────────────────┘
│ MCP Protocol (stdio / http)
┌───────────────────────▼─────────────────────────────────┐
│ AI Context MCP Server │
│ │
│ ┌────────────┐ ┌────────────┐ ┌──────────────────┐ │
│ │ Registry │ │ Fetcher │ │ Semantic Ranker │ │
│ │ (57 libs) │ │ (GitHub + │ │ (MiniLM-L6-v2) │ │
│ └────────────┘ │ Cache) │ └──────────────────┘ │
│ └────────────┘ │
│ ┌────────────┐ ┌────────────┐ ┌──────────────────┐ │
│ │ Changelog │ │ Snippet │ │ Source │ │
│ │ Parser │ │ Extractor │ │ Signature │ │
│ └────────────┘ └────────────┘ └──────────────────┘ │
│ │
│ L1: In-Memory LRU │ L2: SQLite (offline) │
└───────────────────────────────────────────────────────────┘
Contributing
See CONTRIBUTING.md for full guidelines.
npm run dev # ts-node with hot reload
npm test # 39 Jest tests
npm run build # Compile TypeScript
npm run add-library # Interactive library adder
Project structure:
src/
├── server.ts # Entry point
├── registry/libraries.json # Add libraries here
├── sources/ # GitHub, NPM, PyPI, HuggingFace
├── ranking/ # Semantic ranker + snippet extractor
├── cache/ # Two-tier LRU + SQLite cache
└── tools/ # changelog, versions, migrate, suggest
Troubleshooting
"Cannot find module" on start
npm run build
GitHub 403 / rate limit errors
Add GITHUB_TOKEN to your env — create a token with no extra scopes.
Stale/outdated docs returned
rm -f .cache/ai-context-cache.db
First npx run hangs
The MiniLM model downloads (~25MB) on first run. This is one-time only.
More help in docs/TROUBLESHOOTING.md · Open an issue
License
<p align="center"> <a href="https://github.com/Prathmeshkunturwar/Context_Mcp/issues">🐛 Report Bug</a> · <a href="https://github.com/Prathmeshkunturwar/Context_Mcp/issues">✨ Request Feature</a> · <a href="CONTRIBUTING.md">🤝 Contribute</a> </p> <p align="center">If this saves you time, please ⭐ the repo!</p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。