feat(fleet-mcp): Add coder_metadata resource for MCP server configuration#840
feat(fleet-mcp): Add coder_metadata resource for MCP server configuration#840
Conversation
…tion This commit adds a new MCP resource to the fleet-mcp application that provides Claude desktop MCP server configuration for easy setup and connection. Changes: - Added @mcp.resource decorator for config://coder_metadata URI - Resource returns JSON configuration for mcp-remote connection - Includes complete setup instructions in resource documentation - Configuration uses environment variable for bearer token authentication The resource provides ready-to-use JSON that can be copied directly into Claude desktop config file, making it easier for users to configure their MCP connection to the fleet-mcp server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
|
||
|
|
||
| @mcp.resource("config://coder_metadata") | ||
| def get_coder_metadata_config() -> str: |
There was a problem hiding this comment.
Implement the metadata inside the coder workspace template using Terraform https://registry.terraform.io/providers/coder/coder/latest/docs/resources/metadata, not by adding a MCP tool call.
Add minor version plan for the new coder_metadata MCP resource feature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Address review feedback by implementing the MCP configuration metadata as a Terraform coder_metadata resource in the workspace template instead of as an MCP resource in the fleet-mcp application. Changes: - Add coder_metadata resource to coder-devcontainer template with MCP config - Remove incorrect MCP resource implementation from fleet-mcp __main__.py - Update version plan to reflect both fleet-mcp and coder-devcontainer changes - MCP configuration now includes bearer token automatically populated The metadata is now visible in Coder workspace UI and can be copied directly for Claude desktop MCP configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Review Feedback AddressedI've addressed the review comment about implementing this using Terraform's Changes made:
The metadata is now available in the Coder workspace UI's metadata panel at @mvgijssel Please let me know if this looks correct now! |
| "args": [ | ||
| "-y", | ||
| "mcp-remote", | ||
| "https://macbook-pro-van-maarten.tail2c33e2.ts.net/@maarten/maarten.main/apps/fleet-mcp/mcp", |
There was a problem hiding this comment.
Is the url available in one of the coder data resources using terraform? For example https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace
|
@mvgijssel Good question! I looked into the available Coder data sources but I'm not sure which field contains the base access URL. I can see that we have:
The missing piece is the base URL ( Looking at the coder_workspace data source docs, I don't see an Could you point me to the specific field or method to get the base Coder URL? Options I can think of:
Thanks! |
Summary
Adds a new MCP resource to fleet-mcp that provides ready-to-use Claude desktop MCP server configuration for easy setup and connection to the fleet-mcp server via mcp-remote.
Changes
@mcp.resourcedecorator forconfig://coder_metadataURI in__main__.pyBenefits
Resource Details
config://coder_metadataUsage Example
Users can read the resource via MCP client:
The returned JSON can be copied directly into:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonTesting
🤖 Generated with Claude Code