Skip to content

feat: add MCP resources capability and rename server to serve#25

Open
arslan38 wants to merge 7 commits intomainfrom
feature/merge-friendleness
Open

feat: add MCP resources capability and rename server to serve#25
arslan38 wants to merge 7 commits intomainfrom
feature/merge-friendleness

Conversation

@arslan38
Copy link
Member

Summary

  • Rename agit server command to agit serve for CLI consistency
  • Add MCP resources capability with agit://history/recent resource
  • Enable seamless upgrades via agit init --update

Changes

Command Rename

  • agit serveragit serve

MCP Resources

  • Declare resources capability in MCP initialize response
  • Add resources/list and resources/read handlers
  • Implement agit://history/recent resource (returns recent commit summaries)

Seamless Upgrades

  • agit init generates MCP configs with new serve command
  • agit init --update auto-migrates existing configs from server to serve

Usage

New users:

agit init

Introduce MemoryNode struct and FileMemoryStore for storing memories
as individual SHA-256-hashed JSON files in sharded directories
(.agit/objects/memories/{hash[0..2]}/{hash[2..]}.json).

This eliminates merge conflicts when multiple users generate different
memories on separate branches - git merge simply keeps both files.

- MemoryNode: wraps IndexEntry with commit_hash linking
- MemoryStore trait: save_memory, get_all_memories, filter by commit
- FileMemoryStore: SHA-256 sharding like Git's object storage
- MemoryMigration: converts legacy log.json to new format
Rename the MCP server command for consistency with common CLI patterns.
- Rename Commands::Server to Commands::Serve
- Rename ServerArgs to ServeArgs
- Rename server.rs to serve.rs
- Update command dispatch in main.rs
- Update MCP integration tests
Add support for MCP resources, allowing AI clients to read project context
through standard resource URIs.

- Add ResourcesCapability, ResourceDefinition, ResourceReadParams,
  ResourceContent, ResourceReadResult types to protocol.rs
- Declare resources capability in initialize response
- Add resources/list and resources/read handlers
- Implement agit://history/recent resource for recent commit summaries
Enable seamless upgrades for existing users by migrating MCP configs
from 'server' to 'serve' command during init --update.

- Add update_mcp_configs() to update existing .mcp.json, .cursor/mcp.json,
  and .vscode/mcp.json files
- Update generate_mcp_config() to use 'serve' for new installations
- Include MCP config update in --update flow
Update command references from 'server' to 'serve' in documentation.
@arslan38 arslan38 requested a review from hikmedit January 13, 2026 19:07
@arslan38 arslan38 self-assigned this Jan 13, 2026
@arslan38 arslan38 added the enhancement New feature or request label Jan 13, 2026
Replace closure with direct function reference in memory migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant