Commit 15b5bab
feat: add inline MCP servers (#5)
* feat: add inline MCP server support
Implement inline MCP servers that can be defined directly in config
without needing separate MCP server processes. This allows quick
creation of simple tools using any command (docker, shell, etc).
Key features:
- Define tools directly in mcp-front config
- Execute any command with template argument support
- Support for environment variables using {"$env": "..."} syntax
- Full SSE/JSON-RPC protocol implementation
- Flexible execution model (docker, firecracker, raw commands)
Example use cases:
- Wrapping CLI tools (gcloud, aws, kubectl)
- Simple data transformations
- Quick debugging utilities
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: add comprehensive tests for inline MCP servers
- Add interface-based dependency injection for better testability
- Implement proper JSON-RPC over HTTP status codes (400 for invalid JSON)
- Create thorough unit tests for handler, server, and resolver components
- Test SSE functionality without artificial timeouts or infinite loops
- Follow Go idioms and existing project test patterns
- Fix ParseConfigValue capitalization in config tests
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: update OAuth tests to use correct binary and improve inline MCP servers
- Fix OAuth tests to use startMCPFront helper instead of hardcoded binary path
- Update remaining OAuth test functions to use correct binary location
- Remove unhelpful comment from test configuration
- Improve inline MCP server session management with secure session IDs
- Add proper message endpoint path for MCP protocol compliance
- Update test utilities to support both stdio and inline server types
- Add comprehensive integration tests for inline MCP servers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: add proper error handling for JSON encoding in inline handlers
- Check error returns from json.NewEncoder().Encode() calls
- Add error logging for failed JSON operations
- Fix golangci-lint errcheck violations in inline MCP server code
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: remove bash syntax from config files and use native tool env vars
- Replace complex shell commands with simple gcloud/gsutil commands
- Use native GOOGLE_APPLICATION_CREDENTIALS and CLOUDSDK_CORE_PROJECT env vars
- Remove all bash-style $VAR syntax and temp file creation
- Simplify test config to use direct echo command
- All configs now pass validation without warnings
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* docs: improve documentation and apply go fmt
- Add communication and design philosophy section to CLAUDE.md
- Update README with explanation of JSON env var syntax design rationale
- Apply go fmt to ensure consistent code formatting across the project
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: remove template substitution from inline MCP servers
- Remove processTemplateArgs function and template processing
- Update tests to not expect template substitution
- Fix config examples to use static arguments
- Keep Docker -e flags for environment variable passing
- Inline servers now work exactly like stdio but per-tool
Template substitution was an unnecessary feature that:
- Added complexity
- Was inconsistent with stdio servers
- Violated mcp-front's explicit configuration philosophy
- Was incorrectly placed in the inline package
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* refactor: create centralized JSON-RPC package
- Create internal/jsonrpc package with types, errors, and writer utilities
- Migrate inline handler to use the new package
- Migrate server MCP handler to use the new package
- Replace all interface{} with any
- Fix JSON-RPC error HTTP status (should be 200 for valid errors)
- Remove duplicate JSON-RPC error handling code
This centralizes all JSON-RPC handling in one place, making it easier
to maintain and ensuring consistent behavior across the codebase.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: implement systematic t.Cleanup() for integration tests
- Add automatic cleanup registration in startMCPFront()
- Remove manual defer stopMCPFront() calls from all tests
- Implement graceful shutdown (SIGINT → SIGKILL after 5s timeout)
- Eliminate orphaned process issues that caused port conflicts
- Simplify test code by removing unused command variables
- Complete code deduplication with centralized json/cookie packages
- Update CLAUDE.md communication standards
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 38eeb30 commit 15b5bab
File tree
55 files changed
+2660
-377
lines changed- docs
- integration
- config
- internal
- auth
- client
- config
- cookie
- crypto
- inline
- jsonrpc
- json
- oauth
- server
- sse
- storage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
55 files changed
+2660
-377
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | | - | |
| 159 | + | |
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments