Problem
Modern IDE agents (Cursor, Windsurf, Roo Code) use the Model Context Protocol (MCP) to discover tools and resources. Currently vimit has no MCP interface, so IDE integration requires manual plugin setup.
Solution
Expose vimit as an MCP server that provides:
- Resources - read-only access to:
- Cache contents (stored responses per endpoint)
- Trend data (historical usage from redb)
- Current status snapshot (limits, latency, active endpoint)
- Tools - actions the IDE can invoke:
check_limits - run a status check and return results
invalidate_cache - force clear a specific endpoint cache
switch_account - rotate to the next configured account
- Prompts - reusable prompt templates:
- Usage summary prompt for code review context
Architecture
- Listen on stdio (standard MCP transport for IDE plugins)
- Add
--mcp flag to start in MCP server mode
- Reuse existing HttpClient, CacheStore, Router, TrendStore
- Use the
mcp-rs or rmcp crate (check ecosystem)
Acceptance Criteria
- vimit --mcp starts an MCP server on stdio
- IDE can discover resources and tools via mcp list
- check_limits tool returns valid JSON matching existing output
- cache resource returns cached entries
Problem
Modern IDE agents (Cursor, Windsurf, Roo Code) use the Model Context Protocol (MCP) to discover tools and resources. Currently vimit has no MCP interface, so IDE integration requires manual plugin setup.
Solution
Expose vimit as an MCP server that provides:
check_limits- run a status check and return resultsinvalidate_cache- force clear a specific endpoint cacheswitch_account- rotate to the next configured accountArchitecture
--mcpflag to start in MCP server modemcp-rsorrmcpcrate (check ecosystem)Acceptance Criteria