feat: add MCP resources capability and rename server to serve#25
Open
feat: add MCP resources capability and rename server to serve#25
Conversation
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.
Replace closure with direct function reference in memory migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agit servercommand toagit servefor CLI consistencyagit://history/recentresourceagit init --updateChanges
Command Rename
agit server→agit serveMCP Resources
resourcescapability in MCP initialize responseresources/listandresources/readhandlersagit://history/recentresource (returns recent commit summaries)Seamless Upgrades
agit initgenerates MCP configs with newservecommandagit init --updateauto-migrates existing configs fromservertoserveUsage
New users: