feat: add MCP tool to expose server version#519
Conversation
|
Is this primarily for bug reporting and debugging? |
Yes. You don't like the idea? |
|
@b-per I think it is a bit untraditional. For MCP, resources typically refer to items in a filesystem or a similar system. Referring to this repo, resources are supported in most major clients, but not all. How does this appear in a client like Cursor or Claude? Does the UX get in the way when users aren't debugging their dbt MCP setup? Could you provide a screenshot? I wonder if there is a different way we could get this information, for instance, by adding |
|
Not to throw a wrench in the convo, but the MCPB work necessitated a bespoke/adhoc way to retrieve the version number of this package in order to keep the manifest.json's semantic version in sync with the project. I'm wondering if there could be work to standardize an internal function/module such that we can both use it in the MCPB script as well as surface the CLI flag to the user: Edit: Oh, realizing that not all use of the MCP will make a CLI flag possible. Now I understand the tool call aspect |
Changing a bit topics, but shouldn't we update the logic you added to MCPB with the builtin import/function |
|
@jairus-m @b-per I think adding a tool for this would be okay if it were off by default. Is there any other debug information that we would want this tool to provide? Unfortunately, I understand the issue you are referring to with certain clients not working with CLI arguments, @jairus-m. Another option would be to create a separate entrypoint: edit: I just realized that |
But that is just part of the use case. |
9a20ff5 to
06f86db
Compare
|
06f86db to
8bce49d
Compare
8bce49d to
9318d8d
Compare
e09a0de to
128ece0
Compare
|
I was also thinking that in the future we could expend the
This could maybe be used for LLMs to self troubleshoot why the MCP server is not working as expected and what config changes are required to make it work. |
|
@b-per Nice I like that idea! |
DevonFulcher
left a comment
There was a problem hiding this comment.
Nice! I think we should update this PR title.
## Summary Addressing the [comment](#519 (comment)) @b-per suggested for using Python's built-in `importlib.metadata` module for version retrieval instead of running git in a subprocess to retrieve the latest tag. ## Checklist - [x] I have performed a self-review of my code - [ ] I have made corresponding changes to the documentation (in https://github.com/dbt-labs/docs.getdbt.com) if required -- Mention it here - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes
Add a new get_mcp_server_version tool that returns the current version of the dbt-mcp server. This toolset is disabled by default and can be enabled via DBT_MCP_ENABLE_MCP_SERVER_METADATA=true.
128ece0 to
ada3c28
Compare


Previous implementation with a resource
Summary
Add a resource at
dbt://server/versionthat returns the currentdbt-mcp server version. This allows clients to discover the server
version through MCP's resource discovery mechanism rather than
needing a tool call.
The version is retrieved from package metadata at runtime, falling
back to "unknown" if the package metadata cannot be read.
Testing
I tested it with
mcpc:Summary
Add a tool to get the version of the dbt MCP server
It can be useful to troubleshoot the MCP server (e.g. why some tools don't appear etc...)