This is a customized version of NextChat that adds the ability to create and deploy MCP (Model Context Protocol) servers through chat interactions, using OpenRouter for LLM models.
git clone https://github.com/vredrick2/NextChat.git
cd NextChat
npm install
# or
yarn
.env.local
file with the following content:# Enable MCP functionality
ENABLE_MCP=true
# OpenRouter API key
OPENAI_API_KEY=your_openrouter_api_key
# Set OpenRouter as the base URL
BASE_URL=https://openrouter.ai/api/v1
# Default model (can be changed to any OpenRouter model)
DEFAULT_MODEL=openrouter/anthropic/claude-3-opus
# Hide user API key input since we'll be using OpenRouter
HIDE_USER_API_KEY=1
# Enable custom models
CUSTOM_MODELS=+openrouter/anthropic/claude-3-opus,+openrouter/anthropic/claude-3-sonnet,+openrouter/google/gemini-pro
npm run dev
# or
yarn dev
The MCP server creation interface is implemented as a React component that guides users through the process of creating and deploying an MCP server. The interface includes:
Tools are extracted from user descriptions using pattern matching. The system looks for keywords that indicate specific tool types, such as:
The current implementation simulates deployment with mock URLs. In a production environment, this would be connected to a real deployment service.
The system generates integration guides for various AI systems:
/app/utils/mcp/types.ts
: TypeScript interfaces for MCP servers and tools/app/utils/mcp/storage.ts
: Storage utilities for managing MCP servers/app/utils/mcp/extraction.ts
: Tool extraction functionality/app/utils/mcp/deployment.ts
: Deployment utilities/app/utils/mcp/chat-integration.ts
: Chat integration utilities/app/api/mcp/create/route.ts
: API endpoint for creating MCP servers/app/components/mcp/server-creation.tsx
: MCP server creation component/app/components/mcp/server-list.tsx
: MCP server list componentThis project is licensed under the MIT License - see the LICENSE file for details.
NextChat with MCP server creation functionality and OpenRouter integration