feat(tools): create_skill + add_mcp_server — agent-driven scaffolding from chat#498
Merged
Merged
Conversation
…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
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 newSkillStore.createWithContentthat shares the same path resolution + collision check as/skill new. Refuses to overwrite.add_mcp_server— builds aname=...spec for stdio / sse / streamable-http;from_cataloghydratescommand+argsfrom the bundled MCP_CATALOG. Runs the existingpreflightStdioSpec(filesystem sandbox-dir check) and appends tocfg.mcpviawriteConfig. Refuses name collisions. New servers take effect on next launch — no live client churn.Both register inside
registerScaffoldToolsand are wired up inreasonix codeafterregisterTodoTool.Closes #494
Test plan
tests/tools-scaffold.test.ts— 16 new cases: project/global scope, frontmatter forrunAs: 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).