Principle:0sec labs 0 Server Configuration
| Knowledge Sources | |
|---|---|
| Domains | MCP, Server, Agent_Integration |
| Last Updated | 2026-10-30 00:00 GMT |
Overview
Technique for configuring an MCP (Model Context Protocol) server over stdio transport that exposes security analysis tools to external AI agents with configurable backend, target, scope, and rate limiting.
Description
Server configuration is the principle of using the MCP SDK's McpServer and StdioServerTransport to bridge a security analysis engine to external AI agents. The server is configured with McpServerOptions controlling the engine backend, scan target, tool allowlist, scope file, rate limit spec, workflow exposure, engagement profile, and WAF evasion. Tool names are resolved from two sets: MCP_LIVE_TOOL_NAMES (http_request, crawl, submit_form, save_finding, etc.) and MCP_WORKFLOW_TOOL_NAMES (list_workflows, start_run, etc.). Zod schemas are built per tool from ToolDefinition.parameters for MCP parameter validation.
Usage
Use this principle when exposing security analysis tools to external AI agents via the MCP protocol. The stdio transport enables integration with any MCP-compatible agent (Claude, GPT, etc.).
Theoretical Basis
The MCP server setup:
# Abstract model (NOT real implementation)
server = McpServer(name="0security", version="0.25.0")
transport = StdioServerTransport()
# Resolve tool set from options
tool_names = resolve_tool_names(opts.tools, opts.workflows)
# Register each tool with Zod schema validation
for tool_name in tool_names:
definition = getToolsForRole(role).find(tool_name)
schema = build_zod_schema(definition.parameters)
server.register_tool(tool_name, schema, executor.dispatch)
server.connect(transport)
The MCP protocol defines a JSON-RPC 2.0 message format over stdio. The server advertises its capabilities (tools, resources, prompts) and the agent calls tools with structured arguments validated by Zod schemas.