How MCP Prompts Translate into Slash Commands and Resources Map to '@' References in DeepSeek-Reasonix
Reasonix converts MCP server prompts into slash commands using the /mcp__<server>__<prompt> format and exposes resources via @<server>:<uri> syntax, enabling model interaction with external tools through standardized namespaces.
DeepSeek-Reasonix treats each MCP (Model-Centered Plugin) server as a distinct namespace, transforming advertised capabilities into intuitive command-line interfaces. This architecture allows users to invoke complex prompt templates through slash commands and embed external resources using '@' references. Understanding these mappings is essential for integrating MCP servers effectively into your Reasonix workflows.
Understanding MCP Prompt to Slash Command Translation
When an MCP server advertises available prompts through the prompts/list RPC, Reasonix does not expose these raw names directly to the model. Instead, it constructs a model-visible tool name by applying a strict prefixing convention that creates unambiguous slash commands.
The Namespace Convention
In internal/plugin/prompts.go (line 54), Reasonix assembles tool names using the following pattern:
Name: "mcp__" + normalizeName(c.name) + "__" + normalizeName(p.Name),
This generates commands in the format /mcp__<server>__<prompt>, where:
<server>represents the configured server name from your[[plugins]]definition (eitherstdioorhttptype)<prompt>corresponds to the original prompt name returned by the server'sprompts/listRPC
For example, if a server named docs advertises a prompt called summarize, Reasonix exposes this as /mcp__docs__summarize.
Parsing Slash Command Arguments
The command body—everything following the first space—is parsed into positional arguments that map sequentially to the prompt's declared PromptArg parameters. This behavior mirrors Claude Code's MCP client implementation.
When you executing a command like:
/mcp__docs__summarize The quickstart guide
Reasonix performs the following operations:
- Parses the command to identify
server="docs"andprompt="summarize" - Maps "The quickstart guide" to the prompt's first declared argument
- Invokes
Prompt.Getininternal/plugin/prompts.go, which calls the MCP RPCprompts/get - Concatenates the returned messages into a single text block prepended to the model's input
The resolution logic in internal/control/input.go (line 500) handles this via the MCPPrompt function, ensuring arguments align with the server's expected schema.
How Resources Map to '@' References
Beyond prompts, MCP servers expose resources—files, API schemas, or documents—that Reasonix makes accessible through a concise reference syntax.
Resource Reference Syntax
Resources use the format @<server>:<uri>, where:
<server>identifies the MCP server name defined in your configuration<uri>represents the canonical resource URI as exposed by the server'sresources/listendpoint
The Resource struct in internal/plugin/resources.go (lines 10-12) defines this relationship:
type Resource struct {
Server string // owning server name
URI string // canonical resource uri
// …
}
Fetching Resource Content
When the Reasonix UI detects an @ token in chat input, it triggers readResource (line 50 in internal/plugin/resources.go). This function executes the MCP RPC resources/read, retrieves the resource content, and flattens text data (or notes binary blobs) directly into the conversation context.
For example, entering:
Please review the API spec: @docs:file://api/spec.md
Reasonix automatically fetches the markdown content from the docs server and inserts it before the model processes your request.
Practical Implementation Examples
Invoking MCP Prompts via Slash Commands
To use a prompt advertised by an MCP server:
/mcp__docs__summarize The quickstart guide
Here, docs is the server name and summarize is the prompt. The argument "The quickstart guide" maps to the prompt's declared parameter (e.g., text).
Referencing Resources with '@' Syntax
Embed external resources directly into your queries:
Please review the API spec: @docs:file://api/spec.md
Reasonix resolves this by calling readResource, fetching the content via resources/read, and prepending it to your prompt.
Programmatic Construction in Go
When building integrations programmatically, construct these strings following the normalization rules:
// Build a slash command for a prompt
cmd := fmt.Sprintf("/mcp__%s__%s %s", server, prompt, strings.Join(args, " "))
// Build an @‑reference for a resource
ref := fmt.Sprintf("@%s:%s", server, uri)
These strings work with both the Reasonix CLI and TUI, triggering the same resolution pipelines as manual input.
Key Implementation Files
The following source files govern MCP integration:
internal/plugin/prompts.go: Defines prompt name generation (mcp__prefixing) andPrompt.Getlogic for RPC callsinternal/control/input.go(line 500): ContainsMCPPromptfor slash command resolutioninternal/plugin/resources.go: ImplementsResourcestruct andreadResourcefor@reference handlinginternal/cli/chat_tui.go(line 3286): UI detection of/mcp__command stringscmd/reasonix-plugin-example/main.go: Reference implementation showing server-side prompt and resource registration
Summary
- Slash commands follow the format
/mcp__<server>__<prompt>, constructed ininternal/plugin/prompts.goby prefixing server and prompt names withmcp__ - Command arguments parse as positional parameters mapped to
PromptArgdeclarations, resolved viaMCPPromptininternal/control/input.go - Resource references use
@<server>:<uri>syntax, triggeringreadResourceininternal/plugin/resources.goto fetch content via theresources/readRPC - Both mechanisms treat MCP servers as namespaces, preventing naming collisions while exposing external capabilities to the model
Frequently Asked Questions
What happens if two MCP servers expose prompts with identical names?
Reasonix prevents collisions by namespacing each prompt with its server identifier. Since slash commands follow the /mcp__<server>__<prompt> format, identical prompt names from different servers remain unique (e.g., /mcp__serverA__analyze vs /mcp__serverB__analyze).
How are arguments passed to MCP prompts when using slash commands?
Arguments provided after the slash command are parsed as positional parameters and mapped in order to the prompt's declared PromptArg definitions. For example, /mcp__docs__summarize "text here" assigns "text here" to the first argument expected by the summarize prompt.
Can I use multiple '@' references in a single prompt?
Yes. Reasonix scans the entire input for @<server>:<uri> tokens and invokes readResource for each occurrence. All fetched resources are prepended to the model's context before processing your request, allowing you to combine multiple external sources.
What is the difference between 'prompts' and 'resources' in the MCP protocol?
Prompts are templates that require arguments and generate structured messages via the prompts/get RPC, exposed as slash commands. Resources are static content (files, schemas, documents) accessed via resources/read and referenced using @ syntax, requiring no additional arguments beyond the URI.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →