-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Add mcp tools support #282
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
Merged
Merged
Changes from 45 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
91c168d
feat(mcp): add Model Context Protocol integration
yuchou87 ce3fc4b
feat(docker): add full-featured Docker image with MCP tools support
yuchou87 51ed54a
refactor(docker): switch to node:24-bookworm-slim base image
yuchou87 b9c2b35
fix(docker): override entrypoint in test script to avoid interactive …
yuchou87 c057423
refactor(docker): migrate to docker compose v2 syntax
yuchou87 1c9c320
fix(docker): ensure uv is accessible in system PATH
yuchou87 1764181
fix(docker): correct uv installation path
yuchou87 fcedba1
fix(docker): add profiles to build commands
yuchou87 e91e716
fix(docker): use service names instead of --profile flag for build
yuchou87 acb974f
Merge branch 'main' into mcp-tools-support
yuchou87 87e0336
chore(deps): format go.mod
yuchou87 2461069
chore(docker): add execute permission to test script
yuchou87 77d26e5
fix(mcp): return aggregated error when all servers fail to connect
yuchou87 a4265b3
fix(mcp): resolve relative envFile paths against workspace directory
yuchou87 a026d56
chore(deps): consolidate indirect require for uritemplate
yuchou87 20f8bb2
refactor(tools): use MCPManager interface in NewMCPTool constructor
yuchou87 02c1792
fix(tools): preserve MCP tool InputSchema via JSON marshal/unmarshal
yuchou87 aed7296
fix(agent): tie MCP connections to agent lifecycle context
yuchou87 2318232
fix(agent): ensure MCP cleanup on all Run() exit paths
yuchou87 0f6fadb
fix(agent): register MCP tools after server initialization
yuchou87 6892d00
perf(agent): reduce memory footprint by storing minimal MCP dependencies
yuchou87 4113190
chore(config): remove example MCP servers from default config
yuchou87 e38364b
build(docker): migrate full image from Debian to Alpine base
yuchou87 47533a0
style: format code with gofmt
yuchou87 a5d2e10
chore: merge main branch into mcp-tools-support
yuchou87 ffa0198
fix(agent): scope MCP manager cleanup to successful initialization
yuchou87 dea381c
improve(agent): clarify MCP tool registration logging
yuchou87 f0ce26f
style(config): use snake_case for EnvFile JSON field name
yuchou87 7577414
fix(mcp): ensure proper environment variable override semantics
yuchou87 f1b7984
fix(mcp): prevent race condition between CallTool and Close
yuchou87 a7a4e88
fix(agent): use fallback workspace path for MCP initialization
yuchou87 d867e86
Merge branch 'main' into mcp-tools-support
yuchou87 fb2b594
fix(scripts): specify service name in docker compose build
yuchou87 246fdf3
fix(mcp): guard against nil result from CallTool
yuchou87 59e9c55
docs(config): restore MCP server examples in config.example.json
yuchou87 33058b5
fix(mcp): reject empty keys in loadEnvFile
yuchou87 d2b3fc1
fix(mcp): include server name and cause in Close() errors
yuchou87 11dbc30
perf(agent): cache ListAgentIDs() result before MCP tool registration…
yuchou87 cfc29a1
fix(mcp): prevent use-after-close race between CallTool and Close
yuchou87 672da98
Merge branch 'main' into mcp-tools-support
yuchou87 6aade43
docs: add MCP tool configuration documentation
yuchou87 16a3b96
fix(mcp): validate workspace before resolving relative env_file
yuchou87 4e330b2
test(mcp): add manager behavior and lifecycle unit tests
yuchou87 257b0d8
Merge branch 'main' into mcp-tools-support
yuchou87 077d7c8
chore: fix lint issues in mcp and agent packages
yuchou87 ef738f4
fix: address PR review feedback for MCP tools support
yuchou87 0eec640
fix: correct MCP server install test in test-docker-mcp.sh
yuchou87 a2591e0
fix: improve MCP tool name collision safety and registry overwrite wa…
yuchou87 4e348e3
Merge branch 'main' into mcp-tools-support
yinwm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # ============================================================ | ||
| # Stage 1: Build the picoclaw binary | ||
| # ============================================================ | ||
| FROM golang:1.26.0-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make | ||
|
|
||
| WORKDIR /src | ||
|
|
||
| # Cache dependencies | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| # Copy source and build | ||
| COPY . . | ||
| RUN make build | ||
|
|
||
| # ============================================================ | ||
| # Stage 2: Node.js-based runtime with full MCP support | ||
| # ============================================================ | ||
| FROM node:24-alpine3.23 | ||
|
|
||
| # Install runtime dependencies | ||
| RUN apk add --no-cache \ | ||
| ca-certificates \ | ||
| curl \ | ||
| git \ | ||
| python3 \ | ||
| py3-pip | ||
|
|
||
| # Install uv and symlink to system path | ||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ | ||
| ln -s /root/.local/bin/uv /usr/local/bin/uv && \ | ||
| ln -s /root/.local/bin/uvx /usr/local/bin/uvx && \ | ||
| uv --version | ||
|
|
||
| # Copy binary | ||
| COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw | ||
|
|
||
| # Create picoclaw home directory | ||
| RUN /usr/local/bin/picoclaw onboard | ||
|
|
||
| ENTRYPOINT ["picoclaw"] | ||
| CMD ["gateway"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| services: | ||
| # ───────────────────────────────────────────── | ||
| # PicoClaw Agent (one-shot query) - Full MCP Support | ||
| # docker compose -f docker-compose.full.yml run --rm picoclaw-agent -m "Hello" | ||
| # ───────────────────────────────────────────── | ||
| picoclaw-agent: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.full | ||
| container_name: picoclaw-agent-full | ||
| profiles: | ||
| - agent | ||
| volumes: | ||
| - ./config/config.json:/root/.picoclaw/config.json:ro | ||
| - picoclaw-workspace:/root/.picoclaw/workspace | ||
| - picoclaw-npm-cache:/root/.npm # npm cache for faster MCP server installs | ||
| entrypoint: ["picoclaw", "agent"] | ||
| stdin_open: true | ||
| tty: true | ||
|
|
||
| # ───────────────────────────────────────────── | ||
| # PicoClaw Gateway (Long-running Bot) - Full MCP Support | ||
| # docker compose -f docker-compose.full.yml --profile gateway up | ||
| # ───────────────────────────────────────────── | ||
| picoclaw-gateway: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.full | ||
| container_name: picoclaw-gateway-full | ||
| restart: unless-stopped | ||
| profiles: | ||
| - gateway | ||
| volumes: | ||
| # Configuration file | ||
| - ./config/config.json:/root/.picoclaw/config.json:ro | ||
| # Persistent workspace (sessions, memory, logs) | ||
| - picoclaw-workspace:/root/.picoclaw/workspace | ||
| # NPM cache for faster MCP server installs | ||
| - picoclaw-npm-cache:/root/.npm | ||
| command: ["gateway"] | ||
|
|
||
| volumes: | ||
| picoclaw-workspace: | ||
| picoclaw-npm-cache: # Cache npm packages to speed up MCP server installations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.