-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: rewrite MCP server in Go #29
Conversation
This will allow tools such as go build/install to know the name of the generated binary, and allow additional binaries in the future.
To make the migration easier for users I was hoping we could continue with our Python package and shove a platform-specific Go binary inside the package wheel, and use a tiny |
I think that can be a future PR, and I am not sure if it is really necessary either. If we can have easy instructions for installing the go binary then having a Python wrapper would just make things more complicated. |
Turns out that we need v1/ as a suffix, with the training slash, in the Incident URL for the client to work. I added both a cloud test that can be run locally to make sure everything works, as well as a unit test to test this specific issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed one small issue with incident not working, but otherwise looks good. If my most recent commit looks ok let's get this in!
List incidents and list datasources can use a lot more context than necessary when returning results. For dashboards use a custom struct that only returns a few fields. For incidents use the preview incident endpoint which returns a more concise format.
Limit the amount of data returned for list tools
This PR removes the existing Python implementation of the MCP server and adds a Go version.
The server can be started in either stdio or SSE mode based on the arguments. We still need to add some more flags for e.g. host and port of SSE mode.
Tools are factored into a separate package which can be imported from elsewhere. Using a similar method to the
mcp-golang
SDK, we use reflection to inspect the types of the functions and generate tool definitions, used for thelist_tools
functionality.TODO:
Maybe later?