Skip to content

feat: add MCP server for AI agent interactions - #49

Open
vycdev2 wants to merge 1 commit into
vycdev:developfrom
vycdev2:feature/mcp-server
Open

feat: add MCP server for AI agent interactions#49
vycdev2 wants to merge 1 commit into
vycdev:developfrom
vycdev2:feature/mcp-server

Conversation

@vycdev2

@vycdev2 vycdev2 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Added an HTTP MCP server exposing Morpheus bot data to AI agents
  • 4 endpoints: GET /api/mcp (info), GET /api/mcp/health, GET /api/mcp/tools, POST /api/mcp/call/{toolName}
  • 11 tools: get_user_stats, get_guild_info, get_economy_summary, get_activity_overview, get_guilds, get_users, get_quotes, get_quote_by_id, get_recent_logs, get_stock_summary, get_leaderboard
  • Configurable via environment variables (API key, URLs)

Files

  • MCP/McpContracts.cs — DTOs and tool definitions
  • MCP/McpApiOptions.cs — Configuration
  • MCP/McpService.cs — Database query logic
  • MCP/McpApiExtensions.cs — DI registration + endpoint mapping
  • Morpheus.Tests/McpServiceTests.cs — 11 unit tests
  • Program.cs — Wired up AddMcpApi() and MapMcpApi()

Verification

  • dotnet build — 0 errors, 0 warnings
  • dotnet test — 201 passed, 0 failed (11 new MCP tests)

Risk

  • Low — additive feature, no existing code modified

Closes #3

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

Implements an HTTP-based MCP (Model Context Protocol) server that exposes
Morpheus bot data and functionality to AI agents through a clean tool-based API.

Endpoints:
- GET /api/mcp - Server info and available tools
- GET /api/mcp/health - Health check
- GET /api/mcp/tools - List all available tools with parameter schemas
- POST /api/mcp/call/{toolName} - Execute a tool with parameters

Tools:
- get_user_stats - User statistics (balance, XP, level, messages, quotes)
- get_guild_info - Guild/server information with settings
- get_economy_summary - Economy overview (balances, UBI pool, vault, stocks)
- get_activity_overview - Global activity metrics
- get_guilds - List all servers with activity stats
- get_users - Paginated user list
- get_quotes - Paginated quotes with filtering
- get_quote_by_id - Single quote details
- get_recent_logs - Recent bot logs with severity filtering
- get_stock_summary - Stock market gainers/losers
- get_leaderboard - Activity leaderboard by XP or messages

Closes vycdev#3
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