Repository navigation
Build an unpublished local MCPB bundle for Commonly MCP (TASK-456) #2585
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
55e128d
feat(mcp): package stdio server as MCPB for Smithery (TASK-456)
lilyshen0722 fc67ac8
docs(mcp): scope MCPB bundle to local evaluation (TASK-456)
lilyshen0722 8ebe2ea
fix(settings): stabilize admin quota owner selection
lilyshen0722 ac26b5b
docs(mcp): bound parent bundle link to local evaluation
lilyshen0722 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
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,15 @@ | ||
| # Commonly MCP bundle | ||
|
|
||
| This builds an unpublished local MCPB archive of `@commonlyai/mcp` for testing in an MCPB client. It includes the server source and production dependencies; it does not fetch code when the client starts. The user supplies a Commonly agent token during installation. Get one from Commonly → Bring your own agent → Bring your own runtime. | ||
|
|
||
| From the repository root: | ||
|
|
||
| ```bash | ||
| node commonly-mcp/mcpb/build.mjs | ||
| ``` | ||
|
|
||
| The output is `commonly-mcp/commonly.mcpb`. To choose another output path, pass it as the first argument. The build checks that the MCPB manifest version matches `commonly-mcp/package.json`. Keep both versions in sync when publishing a new MCP server version. The build uses the pinned `@anthropic-ai/mcpb@2.1.2` packer. | ||
|
|
||
| The MCPB is a packaging option for the existing stdio server. On its own, it does not answer @mentions while the client is idle; run the listener shown on the Bring your own agent page for that behavior. | ||
|
|
||
| The manifest omits `privacy_policies` because Commonly has no live public privacy-policy URL. This archive is for local evaluation only; do not distribute it or submit it to Smithery. Publishing requires a live Commonly privacy policy, an authenticated Smithery namespace, and a separate listing decision. This build does not publish the archive. |
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,40 @@ | ||
| #!/usr/bin/env node | ||
| // Package the published MCP server code and its production dependencies as an | ||
| // MCPB. Keep the staging directory outside the repo so credentials and local | ||
| // development files cannot enter the archive by accident. | ||
| import { mkdtemp, mkdir, copyFile, cp, readFile, rm } from 'node:fs/promises'; | ||
| import { tmpdir } from 'node:os'; | ||
| import { join, dirname, resolve } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { spawnSync } from 'node:child_process'; | ||
|
|
||
| const mcpDir = resolve(dirname(fileURLToPath(import.meta.url)), '..'); | ||
| const repoDir = resolve(mcpDir, '..'); | ||
| const output = resolve(process.argv[2] || join(mcpDir, 'commonly.mcpb')); | ||
| const manifest = JSON.parse(await readFile(join(mcpDir, 'mcpb/manifest.json'), 'utf8')); | ||
| const pkg = JSON.parse(await readFile(join(mcpDir, 'package.json'), 'utf8')); | ||
| if (manifest.version !== pkg.version) { | ||
| throw new Error(`MCPB version ${manifest.version} differs from @commonlyai/mcp ${pkg.version}`); | ||
| } | ||
|
|
||
| const stage = await mkdtemp(join(tmpdir(), 'commonly-mcpb-')); | ||
| const run = (command, args, cwd) => { | ||
| const result = spawnSync(command, args, { cwd, stdio: 'inherit' }); | ||
| if (result.error) throw result.error; | ||
| if (result.status !== 0) throw new Error(`${command} exited ${result.status}`); | ||
| }; | ||
|
|
||
| try { | ||
| const server = join(stage, 'server'); | ||
| await mkdir(server); | ||
| await copyFile(join(mcpDir, 'mcpb/manifest.json'), join(stage, 'manifest.json')); | ||
| await copyFile(join(mcpDir, 'package.json'), join(server, 'package.json')); | ||
| await copyFile(join(mcpDir, 'package-lock.json'), join(server, 'package-lock.json')); | ||
| await copyFile(join(repoDir, 'LICENSE'), join(stage, 'LICENSE')); | ||
| await cp(join(mcpDir, 'src'), join(server, 'src'), { recursive: true }); | ||
| run('npm', ['ci', '--omit=dev', '--ignore-scripts'], server); | ||
| run('npx', ['-y', '@anthropic-ai/mcpb@2.1.2', 'pack', stage, output], mcpDir); | ||
| process.stdout.write(`${output}\n`); | ||
| } finally { | ||
| await rm(stage, { recursive: true, force: true }); | ||
| } |
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,48 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/modelcontextprotocol/mcpb/main/schemas/mcpb-manifest-v0.4.schema.json", | ||
| "manifest_version": "0.4", | ||
| "name": "commonly", | ||
| "display_name": "Commonly", | ||
| "version": "0.3.14", | ||
| "description": "Read Commonly pods and post as a Commonly agent you create, with a token from your Commonly account.", | ||
| "author": { | ||
| "name": "Team Commonly", | ||
| "url": "https://github.com/Team-Commonly/commonly" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Team-Commonly/commonly.git" | ||
| }, | ||
| "homepage": "https://commonly.me", | ||
| "documentation": "https://github.com/Team-Commonly/commonly/tree/main/commonly-mcp", | ||
| "license": "Apache-2.0", | ||
| "keywords": ["commonly", "collaboration", "pods", "agents"], | ||
| "server": { | ||
| "type": "node", | ||
| "entry_point": "server/src/index.js", | ||
| "mcp_config": { | ||
| "command": "node", | ||
| "args": ["${__dirname}/server/src/index.js"], | ||
| "env": { | ||
| "COMMONLY_API_URL": "${user_config.api_url}", | ||
| "COMMONLY_AGENT_TOKEN": "${user_config.agent_token}" | ||
| } | ||
| } | ||
| }, | ||
| "user_config": { | ||
| "api_url": { | ||
| "type": "string", | ||
| "title": "Commonly API URL", | ||
| "description": "API URL for your Commonly instance.", | ||
| "default": "https://api.commonly.me", | ||
| "required": true | ||
| }, | ||
| "agent_token": { | ||
| "type": "string", | ||
| "title": "Commonly agent token", | ||
| "description": "The cm_agent_ token from Bring your own agent in your Commonly account.", | ||
| "sensitive": true, | ||
| "required": true | ||
| } | ||
| } | ||
| } | ||
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.
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.
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.
🗄️ Data Integrity & Integration |
Major | 🏗️ Heavy lift
Resolve the privacy-policy requirement before public submission.
This bundle connects to the Commonly API and handles user data, but the manifest has no
privacy_policiesentry. MCPB specifies a policy URL for an external service that processes user data. The packer can validate the archive without that URL because the schema does not require the field. As the PR description notes, the local artifact remains usable, but public directory submission remains blocked. Publish a real policy and add its URL before submitting the bundle. (github.com)As per path instructions, comment on “broken contracts”; this is a publication-contract gap, not a local launch failure.
Source: Path instructions