Skip to content

Add basic MCP support on the client side#1150

Closed
KacperFKorban wants to merge 17 commits into
rocq-prover:mainfrom
KacperFKorban:vibecoqing
Closed

Add basic MCP support on the client side#1150
KacperFKorban wants to merge 17 commits into
rocq-prover:mainfrom
KacperFKorban:vibecoqing

Conversation

@KacperFKorban

Copy link
Copy Markdown
Contributor

Summary

This PR makes the following changes:

  1. Adds an MCP server with basic ways for progressing/checking the state of the proof. It includes tools for step*, interpret* and proofView actions. (There is a new setting to enable the MCP server, and an additional setting to set the MCP server port)
  2. Changes step* and interpret* events from notifications to requests. (This is done, because LSP requests have their unique ids, when notifications don't). Thanks to this change, the proofView event can also have an optional request_id that identifies the request that triggered this notification.

Discussion

Why add the MCP server/support on the client side?
We initially discussed putting the MCP support on the language-server side, but after going back and forth, I decided to go back to the first approach and do it as part of the vscode extension. The main reasoning was:

  1. Both the server and the client work in an asynchronous way, so there will still be quite a bit of mess related to waiting for the LSP response, and I'd rather have this mess be on the extension side, where it can be reliably decoupled.
  2. MCP servers are almost exclusively used with vscode-clones, so it doesn't introduce any limitations.

@gares gares requested a review from rtetley September 29, 2025 13:08
@gares

gares commented Sep 29, 2025

Copy link
Copy Markdown
Member

Thanks!

@KacperFKorban KacperFKorban marked this pull request as ready for review September 29, 2025 13:15

@rtetley rtetley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from those two questions, I think this is great work ! I don't have a real opinion about where the MCP server should live ! Your assessment sounds good !
Thanks a lot !

@@ -0,0 +1,22 @@
import { PpString } from '../protocol/types';

export const stringOfPpString = (pp:PpString) : string => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the function exposed in the pp-display library ?

| SendProofView None ->
let params = Notification.Server.ProofViewParams.{ proof=None; pp_proof=None; messages=[]; pp_messages=[]; range=Range.top() } in
| SendProofView (None, req_id_opt) ->
let params = Notification.Server.ProofViewParams.{ proof=None; pp_proof=None; messages=[]; pp_messages=[]; range=Range.top(); request_id = req_id_opt } in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems these ProofView events are still Notifications, but you just add an Id to have them functioning like requests ? Is there a reason for not using a Request type ? This is a naive question btw !

@KacperFKorban

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1194

@KacperFKorban

Copy link
Copy Markdown
Contributor Author

Sorry about the long inactivity. I used it a bit and I felt that the MCP server using the same VsRocq session isn't the best design, so I was hesitant to push this forward. I feel way more confident about the new server side implementation #1194

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.

3 participants