-
Notifications
You must be signed in to change notification settings - Fork 119
Add experimental Apps MCP server #3913
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
Conversation
13 failing tests:
Top 30 slowest tests (at least 2 minutes):
|
lennartkats-db
left a comment
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.
Mostly non-blocking comments, want to get this in ASAP, please review
experimental/apps-mcp/cmd/check.go
Outdated
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.
Non-blocking: this overlaps with check.go in https://github.com/databricks/cli/pull/3907/files?w=1#diff-eb58ee8a5e70c59bc4f77b27698bc7405dffb45d28ca064438c8f8a8a0f57ff6
|
|
||
| The server communicates via stdio using the Model Context Protocol.`, | ||
| Example: ` # Start MCP server with required warehouse | ||
| databricks experimental apps-mcp --warehouse-id abc123 |
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.
Non-blocking: we should apply the "default warehouse" logic from https://github.com/databricks/cli/pull/3907/files?w=1#diff-5af5f7c0874402273882f7e0c97c9bc7a0471ad92771d90ef23c415da090f09aR74 here. That same logic, discussed with the default warehouse team, is also applied in many other client-side tools. We'll get a proper API for it in the future.
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 think we should pull in the complete getting started logic from your PR
|
|
||
| // Define flags | ||
| cmd.Flags().StringVar(&warehouseID, "warehouse-id", "", "Databricks SQL Warehouse ID") | ||
| cmd.Flags().BoolVar(&allowDeployment, "allow-deployment", false, "Enable deployment tools") |
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.
Non-blocking: I don't think we want to keep this concept. And it seems odd to default to false?
| ) | ||
|
|
||
| // JSON-RPC 2.0 error codes as defined in the specification. | ||
| const ( |
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.
Non-blocking note: this is good! we have an equivalent in server.go here https://github.com/databricks/cli/pull/3907/files?w=1#diff-3ee229a3a2abf9ff54e7405e515634100baecd96c94852f8985c156189a14524R49
| return t.writer.WriteEntry(entry) | ||
| } | ||
|
|
||
| func (t *Tracker) RecordToolCall(toolName string, args any, result *mcpsdk.CallToolResult, err error) { |
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.
Non-blocking: this is something we should also have for a CLI-based approach!
experimental/apps-mcp/lib/templates/trpc/client/components.json
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| cmd.AddCommand(aitools.New()) | ||
| cmd.AddCommand(mcp.NewMcpCmd()) |
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.
The aitools package should also nest a cmd package.
experimental/apps-mcp/cmd/check.go
Outdated
| databricks experimental apps-mcp check | ||
| # Check with specific profile | ||
| databricks experimental apps-mcp check --profile production`, |
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.
Is this a tool call or for real users?
We have databricks auth describe that does the same.
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 think this was a carry-over from rust. I'll remove it
- github.com/databricks/databricks-sdk-go v0.90.0 (updated) - Dependencies will be fully populated when code is copied For parity-40 (Phase 2: Code Structure Migration)
Copied all library code with original structure: - Utilities (pathutil, fileutil, version, errors) - Templates (code + embedded) - Sandbox (interface + local + dagger) - Session and trajectory - Providers (databricks, io, workspace, deployment) - MCP server Import paths still reference old package. Will fix in next phase. For parity-40 (Phase 2: Code Structure Migration)
Changed all imports: - github.com/databricks/go-mcp/pkg → github.com/databricks/cli/libs/mcp - github.com/appdotbuild/go-mcp/pkg → github.com/databricks/cli/libs/mcp - github.com/databricks/go-mcp/internal → github.com/databricks/cli/internal/mcp Added MCP dependencies: - github.com/modelcontextprotocol/go-sdk v1.1.0 - github.com/zeebo/blake3 v0.2.4 - dagger.io/dagger v0.19.6 Build still fails due to missing config/logging integration. For parity-40 (Phase 2: Code Structure Migration)
Created libs/mcp/config.go with MCP configuration types. Removed dependency on pkg/config (which used Viper). Configuration will be populated from command flags in Phase 3. Updated all imports: - config.Config → mcp.Config - config.IoConfig → mcp.IoConfig - config.ValidationConfig → mcp.ValidationConfig - config.DaggerConfig → mcp.DaggerConfig Build still fails due to missing logging integration. For parity-40 (Phase 2: Code Structure Migration)
- Fixed registry.go to use context instead of logger - Fixed trajectory.go to alias mcp SDK import - Removed logger fields from provider structs - Started replacing logger calls with log package Still TODO: - Fix provider init functions - Fix mcp SDK import aliasing in all providers - Complete logger call replacements - Fix ctx variable name conflicts For parity-40 (Phase 2: Code Structure Migration)
- Aliased mcp SDK imports to avoid package conflicts (mcpsdk) - Removed logger parameters from all providers - Added context parameters for logging throughout - All providers now use libs/log package - Renamed server package correctly - Fixed trajectory tracker to use context Build succeeds: go build ./libs/mcp/... For parity-40 (Phase 2: Code Structure Migration)
This renames the command from `databricks experimental mcp` to `databricks experimental apps-mcp` to better reflect its purpose as an Apps-focused MCP server. Changes: - Rename folder: experimental/mcp → experimental/apps-mcp - Update command name: mcp → apps-mcp - Update all import paths across Go files - Update documentation and examples in README - Update acceptance test folder structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace the custom version package in apps-mcp with the top-level build.GetInfo() to ensure version consistency across the CLI. Changes: - Remove experimental/apps-mcp/lib/version directory - Update server.go to import github.com/databricks/cli/internal/build - Use build.GetInfo().Version instead of custom version package - Update MCP server name to "databricks-apps-mcp" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replaced github.com/modelcontextprotocol/go-sdk with a minimal local implementation in experimental/apps-mcp/lib/mcp/ that provides all the functionality needed for the apps-mcp command. Changes: - Created experimental/apps-mcp/lib/mcp/ package with: - types.go: Core MCP types (Implementation, Tool, Content, etc.) - protocol.go: JSON-RPC and MCP protocol types - transport.go: STDIO transport for line-delimited JSON - server.go: MCP server with tool registration and request handling - tool.go: Typed tool handler with automatic schema generation - Updated all providers to use local MCP SDK: - lib/providers/databricks/provider.go - lib/providers/deployment/provider.go - lib/providers/io/provider.go - lib/providers/workspace/provider.go - lib/server/server.go - lib/session/engine_guide.go - lib/trajectory/tracker.go - Removed github.com/modelcontextprotocol/go-sdk from go.mod - Kept github.com/google/jsonschema-go for schema generation All tests pass and linter shows 0 issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Removes the github.com/zeebo/blake3 external dependency and uses the standard library crypto/sha256 instead for computing file checksums in the MCP apps state management. Benefits: - Reduces binary size by ~955 KB (1.72%) - Eliminates external dependency - Uses stable standard library API Both hash implementations follow the same hash.Hash interface, making this a drop-in replacement. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace the custom databricks.Client wrapper with direct use of the workspace client from context (cmdctx.WorkspaceClient), following the pattern used in the rest of the CLI codebase. Changes: - Remove lib/providers/databricks/client.go - Convert all Client methods to standalone functions that accept context and config parameters - Update provider to get workspace client from context instead of storing a custom client instance - Update deployment provider to pass config instead of client This makes the code consistent with other parts of the CLI and eliminates unnecessary abstraction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This commit removes all Dagger-related code, configuration, and documentation from the codebase. The Dagger sandbox implementation has been replaced with a minimal stub that returns "not implemented" errors. Changes: - Removed Dagger sandbox implementation (dagger.go, dagger_test.go, metrics.go) - Created stub implementation that registers with sandbox factory - Removed `databricks experimental apps-mcp check` command - Removed `--use-dagger` and `--docker-image` CLI flags - Removed DaggerConfig and related fields from ValidationConfig - Simplified validation logic to only use local sandbox - Updated README to remove all Dagger/containerization mentions - Removed dagger.io/dagger dependency from go.mod - Updated doc comments to reflect stub-only status 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
pietern
left a comment
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.
Please update the go.mod entries before merging.
Now that it is a single dep it can be included in the main list.
go.mod
Outdated
| google.golang.org/api v0.249.0 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20250922171735-9219d122eba9 // indirect | ||
| google.golang.org/grpc v1.75.1 // indirect | ||
| google.golang.org/grpc v1.76.0 // indirect |
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.
The other bumps are unrelated, please revert (will come in separately).
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.
done
| UpdateTime string `json:"update_time"` | ||
| Updater string `json:"updater"` | ||
| URL string `json:"url"` | ||
| } |
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.
For later PR, these structs duplicate the SDK structs. Why?
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.
This was an artefact from the port. The Rust version had a vibe-coded SDK. I'll strip that code.
cmd/cmd.go
Outdated
| "github.com/databricks/cli/cmd/sync" | ||
| "github.com/databricks/cli/cmd/version" | ||
| "github.com/databricks/cli/cmd/workspace" | ||
| ssh "github.com/databricks/cli/experimental/ssh/cmd" |
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.
Can also revert.
Changes
This PR adds the MCP for building Databricks apps as a new command
databricks experimental mcp.The code is a direct port of the https://github.com/appdotbuild/agent rust code base.
Why
Tests