Implementation:1mcp app Agent instructionsCommand
| Knowledge Sources | |
|---|---|
| Domains | CLI, MCP_Protocol |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete CLI command for fetching aggregated runtime instructions from all connected MCP servers, rendered as text for agent context.
Description
The instructionsCommand function fetches aggregated instructions from the running 1MCP runtime. It connects to the runtime via HTTP API or MCP client surface, requests rendered instructions, and prints them to stdout. Instructions are aggregated from all connected MCP servers and can be filtered by server, preset, or tag. The command supports both the modern REST API and legacy runtime instructions rendering.
Usage
Import this function when you need to:
- Fetch runtime instructions for an AI agent's context
- Get instructions for a specific server
- Filter instructions by preset or tags
Code Reference
Source Location
- Repository: 1MCP Agent
- File: src/commands/instructions/instructions.ts (L37-72)
Signature
export interface InstructionsCommandOptions extends GlobalOptions, ProjectSelectionOptions {
server?: string;
url?: string;
context?: string;
preset?: string;
filter?: string;
tags?: string[];
'tag-filter'?: string;
}
export async function instructionsCommand(options: InstructionsCommandOptions): Promise<void>;
Import
import { instructionsCommand } from '@src/commands/instructions/instructions.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| server | string | No | Specific server instructions |
| url | string | No | Runtime URL |
| context | string | No | Runtime context |
| preset | string | No | Preset filter |
| filter | string | No | Server filter |
Outputs
| Name | Type | Description |
|---|---|---|
| stdout | text | Rendered instructions |
Usage Examples
Fetch Instructions
1mcp instructions
1mcp instructions --server my-server
1mcp instructions --preset dev