Skip to content

feat(plugins): add OpenSpec MCP plugin#1029

Open
bj456736 wants to merge 2 commits into
MoonshotAI:mainfrom
bj456736:auto-pr-20260623-1800
Open

feat(plugins): add OpenSpec MCP plugin#1029
bj456736 wants to merge 2 commits into
MoonshotAI:mainfrom
bj456736:auto-pr-20260623-1800

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

Summary

Introduces kimi-openspec, an official MCP plugin that lets Kimi Code interact with OpenSpec projects.

Changes

  • New plugin plugins/official/kimi-openspec/
    • bin/kimi-openspec.mjs – MCP server (stdio transport) that reads OpenSpec files directly from disk
    • kimi.plugin.json – Plugin manifest
    • SKILL.md – Plugin documentation
  • Updated plugins/marketplace.json – Registered the new plugin
  • Added .changeset/kimi-openspec-plugin.md

Provided Tools

Tool Description
openspec_status Check whether the workspace is an OpenSpec project
openspec_list_changes List all changes under openspec/changes/ with status
openspec_list_specs List all specs under openspec/specs/
openspec_read_change Read proposal.md, design.md, or tasks.md inside a change
openspec_read_spec Read a spec file or list its directory contents

Testing

  • MCP server initializes correctly over stdio
  • Tools list returns all 5 tools with correct schemas
  • Status detection works on non-OpenSpec workspaces (returns graceful fallback)
  • No external dependencies beyond Node.js built-ins

Notes

This is an MVP. Future iterations could add:

  • Support for openspec/config.yaml parsing
  • Tool to create new changes/specs
  • Integration with the OpenSpec CLI (@fission-ai/openspec)

Introduces kimi-openspec, an official MCP plugin for OpenSpec integration.

- openspec_status: detect OpenSpec projects
- openspec_list_changes: list changes with status
- openspec_list_specs: list specs
- openspec_read_change: read proposal/design/tasks
- openspec_read_spec: read spec files

Registered in marketplace.json.
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5d1c59b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@5d1c59b
npx https://pkg.pr.new/@moonshot-ai/kimi-code@5d1c59b

commit: 5d1c59b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8af4f4c22e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return;
}
try {
const cwd = msg.params._meta?.cwd || process.cwd();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use the session workspace for OpenSpec lookups

Kimi does not populate msg.params._meta.cwd when invoking MCP tools: StdioMcpClient.callTool forwards only { name, arguments }, and this plugin's manifest cwd is resolved to the managed plugin directory. As a result this fallback uses the plugin install directory rather than the active session workspace, so even in a repo with openspec/config.yaml, openspec_status and the list/read tools inspect $KIMI_CODE_HOME/plugins/managed/kimi-openspec/openspec and report no project.

Useful? React with 👍 / 👎.

const { spec_id } = args;
// Try as a directory first, then as a file
const dirPath = join(cwd, 'openspec', 'specs', spec_id);
const filePath = join(cwd, 'openspec', 'specs', spec_id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep spec paths inside openspec/specs

When openspec_read_spec is called with a spec_id containing .. and the workspace has an openspec/specs directory, join() normalizes the path outside the specs tree; for example ../../secret.txt reads <workspace>/secret.txt. The advertised schema only requires a string, so Kimi's tool-argument validation will not reject traversal segments; normalize/realpath the result and ensure it remains under openspec/specs before listing or reading.

Useful? React with 👍 / 👎.

- Detect image/* content types in LocalFetchURLProvider
- Read binary body for images, convert to base64 data URI
- Sniff image dimensions when available
- Return image as ContentPart[] with image_url for LLM vision models
- Update tool description to mention image support
- Add tests for image fetching in both tool and provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant