Purpose
vercel-ai-docs-mcp is a Model Context Protocol (MCP) server that provides AI-powered search and query capabilities for the Vercel AI SDK documentation. It lets developers ask questions about the Vercel AI SDK and get accurate, contextual answers based on the official documentation.
Key Capabilities
- Direct documentation search: Use similarity search to directly query the Vercel AI SDK documentation index.
- AI agent: Ask questions related to the Vercel AI SDK in natural language and get comprehensive answers.
- Session management: Maintain conversation context across multiple queries.
- Automatic indexing: Includes tools for fetching, processing, and indexing the latest Vercel AI SDK documentation.
System Components
- MCP Server: Exposes tools through the Model Context Protocol for integration by AI assistants.
- DocumentFetcher: Fetches and processes the Vercel AI SDK documentation.
- VectorStoreManager: Creates and manages the FAISS vector index used for semantic search.
- AgentService: Uses the Google Gemini model to provide AI-powered question answering.
- DirectQueryService: Provides direct semantic search over the documentation.
Usage
Prerequisites: A Google API key is required to access the Gemini model.
Environment variables: Create a .env file in the project root directory and configure the corresponding variables. You need to obtain a Google Gemini API key from Google AI Studio.
Installation and running steps:
- Clone the repository: git clone https://github.com/IvanAmador/vercel-ai-docs-mcp.git cd vercel-ai-docs-mcp-agent
- Install dependencies: npm install
- Build the project: npm run build
- Build the documentation index: npm run build:index
- Start the MCP server: npm run start
Integration with Claude Desktop:
- Install Claude Desktop.
- Open Claude Desktop settings (through the app menu, not the chat interface).
- Go to the "Developer" tab and click "Edit Config".
- Add the Vercel AI Docs MCP server to the configuration, replacing ABSOLUTE_PATH_TO_PROJECT with the actual path to the project folder and replacing your-google-api-key-here with your Google Gemini API key.
- Save the configuration file and restart Claude Desktop.
- Confirm that the server is connected via the hammer 🔨 icon in the Claude chat interface.
Integration with other MCP clients: This MCP server is compatible with any client that implements the Model Context Protocol. Taking Cursor as an example:
- Add a .cursor/mcp.json file in the project directory (project-level configuration), or add a ~/.cursor/mcp.json file in the home directory (global configuration).
- Add the corresponding configuration to the configuration file.
Exposed Tools
This MCP server exposes three main tools:
- Query the Vercel AI SDK documentation using an AI agent that can search and synthesize information.
- direct-query: Perform a direct similarity search on the Vercel AI SDK documentation index.
- clear-memory: Clear the conversation memory of a specific session or all sessions. To clear all sessions, omit the sessionId parameter.
Project Structure-Related Commands
- npm run build: Compile TypeScript files.
- npm run build:index: Build the documentation index.
- npm run dev:index: Build and index in development mode.
- npm run dev: Build and start in development mode.
Use cases
Suitable for developers who need to frequently consult the Vercel AI SDK documentation, allowing them to ask questions in natural language directly in MCP-enabled AI assistants (such as Claude Desktop, Cursor) and receive answers based on the official documentation.
Limitations and troubleshooting
- Index not found or failed to load: Run npm run build:index to create the index before starting the server.
- API rate limits: When the Google API rate limit is exceeded, the agent service may return errors, and an appropriate backoff strategy needs to be implemented.
- Model connection issues: Ensure the Google API key is valid and has access to the specified Gemini model.
- Claude Desktop does not show the MCP server: Check the configuration file for syntax errors; ensure the server path is correct and is an absolute path; check the Claude Desktop logs for errors; restart Claude Desktop after modifying the configuration.
The project welcomes contributions; Pull Requests can be submitted.