-
Notifications
You must be signed in to change notification settings - Fork 455
FR: Add MCP support #6146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm guessing you mean https://modelcontextprotocol.io/introduction? I don't know much about it, I just searched the web for "MCP". Could you explain in a bit more detail what it would mean to expose jj's functions to MCP and what use-cases this would allow? For example, what would be the smallest change with the most bang-for-the-buck, and why? Is there anything analogous for Git or other VCS? |
This is the official Git MCP server: https://github.com/modelcontextprotocol/servers/tree/main/src/git As an example: https://github.com/modelcontextprotocol/servers/blob/main/src/git/src/mcp_server_git/server.py#L100-L110 def git_log(repo: git.Repo, max_count: int = 10) -> list[str]:
commits = list(repo.iter_commits(max_count=max_count))
log = []
for commit in commits:
log.append(
f"Commit: {commit.hexsha}\n"
f"Author: {commit.author}\n"
f"Date: {commit.authored_datetime}\n"
f"Message: {commit.message}\n"
)
return log
MCP is a text-based protocol over stdio/stdout or HTTP. The official SDKs for it are available in Python and TypeScript. But there are people interested in Rust MCP servers: https://github.com/conikeec/mcpr. I think the easiest MVP approach is to use a Rust MCP server SDK for some small subset of jj commands like log, status, and check it works. I'm not sure however if the PR belongs in this repo, or a new repo for a new Rust crate that depends on I'm interested in both jujutsu and MCP servers and I'm happy to look into this. If there are docs on |
My understanding, as someone who learned about MCP literally yesterday, is that this would allow for It the abstract, I can always ask these tools for examples of how to do things, but with MCP, they can answer questions about my repository directly, and act on it, rather than just answer general questions. |
I think it might make sense to make a crate similar to a TUI/GUI crate. It might have to depend on both |
Is your feature request related to a problem? Please describe.
AI tools are more familiar with git but jj fits their natural style better if anything. Its simplicity also helps models not go into death loops.
Describe the solution you'd like
Expose the common functions (like undo =) ) as tools with docs for MCP.
Describe alternatives you've considered
DIY
The text was updated successfully, but these errors were encountered: