Vercel AI SDK Documentation MCP Agent
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol (MCP) server that provides AI-powered search and querying capabilities for the Vercel AI SDK documentation. This project enables developers to ask questions about the Vercel AI SDK and receive accurate, contextualized responses based on the official documentation.
Features
- **Direct Documentation Search**: Query the Vercel AI SDK documentation index directly using similarity search
- **AI-Powered Agent**: Ask natural language questions about the Vercel AI SDK and receive comprehensive answers
- **Session Management**: Maintain conversation context across multiple queries
- **Automated Indexing**: Includes tools to fetch, process, and index the latest Vercel AI SDK documentation
Architecture
This system consists of several key components:
1. **MCP Server**: Exposes tools via the Model Context Protocol for integration with AI assistants
2. **DocumentFetcher**: Crawls and processes the Vercel AI SDK documentation
3. **VectorStoreManager**: Creates and manages the FAISS vector index for semantic search
4. **AgentService**: Provides AI-powered answers to questions using the Google Gemini model
5. **DirectQueryService**: Offers direct semantic search of the documentation
Setup Instructions
Prerequisites
- Node.js 18+
- npm
- A Google API key for Gemini model access
Environment Variables
Create a .env file in the project root with the following variables:
You'll need to obtain a Google Gemini API key from the Google AI Studio.
Installation
1. Clone the repository
2. Install dependencies
3. Build the project
4. Build the documentation index
5. Start the MCP server
Integration with Claude Desktop
Claude Desktop is a powerful AI assistant that supports MCP servers. To connect the Vercel AI SDK Documentation MCP agent with Claude Desktop:
1. First, install Claude Desktop if you don't have it already.
2. Open Claude Desktop settings (via the application menu, not within the chat interface).
3. Navigate to the "Developer" tab and click "Edit Config".
4. Add the Vercel AI Docs MCP server to your configuration:
Make sure to replace:
- ABSOLUTE_PATH_TO_PROJECT with the actual path to your project folder
- your-google-api-key-here with your Google Gemini API key
5. Save the config file and restart Claude Desktop.
6. To verify the server is connected, look for the hammer 🔨 icon in the Claude chat interface.
For more detailed information about setting up MCP servers with Claude Desktop, visit the MCP Quickstart Guide.
Integration with Other MCP Clients
This MCP server is compatible with any client that implements the Model Context Protocol. Here are a few examples:
Cursor
Cursor is an AI-powered code editor that supports MCP servers. To integrate with Cursor:
1. Add a .cursor/mcp.json file to your project directory (for project-specific configuration) or a ~/.cursor/mcp.json file in your home directory (for global configuration).
2. Add the following to your configuration file: