Skip to content

feat: Server-level MCP integration for chat#882

Draft
RhysSullivan wants to merge 1 commit intomainfrom
feat/server-level-mcp-integration
Draft

feat: Server-level MCP integration for chat#882
RhysSullivan wants to merge 1 commit intomainfrom
feat/server-level-mcp-integration

Conversation

@RhysSullivan
Copy link
Collaborator

Summary

Enables Discord server admins to configure MCP (Model Context Protocol) servers for their communities. When users chat about a Discord server on Answer Overflow, the AI will have access to tools from that server's configured MCP servers.

Changes

  • Add MCPServerConfig schema to server preferences (mcpServers field)
  • Create MCP client wrapper utilities (packages/ai/src/tools/mcp-tools.ts):
    • createMCPToolsFromServers() - Connects to multiple HTTP MCP servers and aggregates their tools
    • Tools are prefixed with server name to avoid collisions (e.g., my_server__tool_name)
    • 10 second timeout, graceful error handling
  • Integrate MCP tools into streamChat() - fetches MCP servers from server preferences when a server context is provided
  • Add analytics events for server MCP config management

How It Works

  1. Server admin configures MCP servers in their server preferences (name + URL pairs)
  2. When a user starts a chat with that server's context, streamChat() fetches the server's MCP config
  3. MCP tools from all configured servers are loaded and made available to the AI agent
  4. Tool names are prefixed to avoid collisions between servers

Next Steps

  • Create server admin UI for managing MCP servers (in dashboard/server settings)
  • Add server preference mutations for MCP management (admin-only)

Testing

To test manually:

  1. Add MCP servers to a server's preferences via Convex dashboard
  2. Start a chat with that server's context
  3. Verify MCP tools appear and work in the chat

- Add MCPServerConfig schema to server preferences for Discord server admins
- Create MCP client wrapper utilities for connecting to HTTP MCP servers
- Integrate MCP tools into streamChat - tools from configured servers are
  available when chatting about a Discord server
- Add analytics events for server MCP config management
- Tools are prefixed with server name to avoid collisions
@vercel
Copy link

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
answer-overflow-main-site Ready Ready Preview, Comment Jan 24, 2026 9:51pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant