Skip to content

feat(tools): create_skill + add_mcp_server — agent-driven scaffolding from chat#498

Merged
esengine merged 1 commit into
mainfrom
feat/494-agent-scaffold-skills-mcp
May 9, 2026
Merged

feat(tools): create_skill + add_mcp_server — agent-driven scaffolding from chat#498
esengine merged 1 commit into
mainfrom
feat/494-agent-scaffold-skills-mcp

Conversation

@esengine

@esengine esengine commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adding a skill or wiring up an MCP server today forces the user out to slash commands or hand-edited config — even when they're already in chat asking the agent to do it. This PR gives the model first-class tools so "add a skill that runs typecheck before commits" / "hook up a postgres MCP server" work as normal chat requests.

  • create_skill — structured args (name, description, body, scope, allowed_tools, run_as, model) get serialized into frontmatter so the model never writes raw YAML. Persistence reuses a new SkillStore.createWithContent that shares the same path resolution + collision check as /skill new. Refuses to overwrite.
  • add_mcp_server — builds a name=... spec for stdio / sse / streamable-http; from_catalog hydrates command + args from the bundled MCP_CATALOG. Runs the existing preflightStdioSpec (filesystem sandbox-dir check) and appends to cfg.mcp via writeConfig. Refuses name collisions. New servers take effect on next launch — no live client churn.

Both register inside registerScaffoldTools and are wired up in reasonix code after registerTodoTool.

Closes #494

Test plan

  • tests/tools-scaffold.test.ts — 16 new cases: project/global scope, frontmatter for runAs: subagent + allowed-tools + model, name validation, overwrite refusal, allowed-tools rejection, stdio / sse / streamable-http build, catalog hydrate, missing user-args, missing-dir preflight, name-collision refusal, non-http URL refusal, unknown catalog, missing transport.
  • npm run verify (full suite, 2324 tests).

…rom chat

Two new agent-facing tools so "add a skill that does X" / "wire up a
postgres MCP server" work as normal chat requests instead of forcing the
user out to slash commands:

- `create_skill` — pre-fills frontmatter (description / runAs /
  allowed-tools / model) from structured args and writes through a new
  SkillStore.createWithContent that reuses the same path resolution +
  collision check as `/skill new`.
- `add_mcp_server` — builds a `name=...` spec for stdio / sse /
  streamable-http transports, optionally hydrates from MCP_CATALOG,
  runs the existing preflight (filesystem sandbox-dir check), and
  appends to cfg.mcp via writeConfig. Refuses name collisions.
  Active on next launch — no live MCP client churn this session.

Both are registered alongside the existing native tools in
`reasonix code` so they're available wherever filesystem / shell are.

Closes #494
@esengine esengine merged commit 2462b1c into main May 9, 2026
2 checks passed
@esengine esengine deleted the feat/494-agent-scaffold-skills-mcp branch May 9, 2026 05:06
@esengine esengine mentioned this pull request May 9, 2026
2 tasks
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…rom chat (esengine#498)

Two new agent-facing tools so "add a skill that does X" / "wire up a
postgres MCP server" work as normal chat requests instead of forcing the
user out to slash commands:

- `create_skill` — pre-fills frontmatter (description / runAs /
  allowed-tools / model) from structured args and writes through a new
  SkillStore.createWithContent that reuses the same path resolution +
  collision check as `/skill new`.
- `add_mcp_server` — builds a `name=...` spec for stdio / sse /
  streamable-http transports, optionally hydrates from MCP_CATALOG,
  runs the existing preflight (filesystem sandbox-dir check), and
  appends to cfg.mcp via writeConfig. Refuses name collisions.
  Active on next launch — no live MCP client churn this session.

Both are registered alongside the existing native tools in
`reasonix code` so they're available wherever filesystem / shell are.

Closes esengine#494
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.

agent: let the model scaffold skills and register MCP servers from chat

1 participant