Skip to main content

Cyberstrike is now open source! AI-powered penetration testing for security professionals. Star on GitHub

Local MCP Servers

Local MCP servers run on your machine as child processes, communicating via stdio. This is an alternative to Bolt for users who prefer to run tools directly on their system.

Tip

Prefer Bolt for security tools. Local MCP requires manual tool installation. See Bolt for the recommended approach with 100+ pre-installed Kali tools.

🎞️ MARP SLIDE: local-architecture.md

Local MCP stdio transport architecture

📸 SCREENSHOT: local-mcp-config.png

Local MCP server configuration in cyberstrike.json

When to Use Local MCP

Local MCP servers are best for:

  • Offline environments - No network access required
  • Low latency - Direct process communication
  • Custom tools - Your own MCP servers
  • Privacy - Data never leaves your machine

Architecture

flowchart LR
subgraph Cyberstrike["Cyberstrike Process"]
Agent[AI Agent]
Client[MCP Client]
end
subgraph LocalMCP["Local MCP Server"]
Stdio[Stdio Transport]
Handler[Request Handler]
Tools[Tool Functions]
end
Agent --> Client
Client <-->|stdin/stdout| Stdio
Stdio --> Handler
Handler --> Tools
style Cyberstrike fill:#3b82f6,color:#fff
style LocalMCP fill:#10b981,color:#fff

Overview

Local MCP servers offer:

  • Zero network latency
  • Full data privacy
  • Offline operation
  • Custom tool integration
  • Direct system access

Adding via TUI

The easiest way to add a local MCP server is directly from the Cyberstrike TUI using the /mcps command.

Opening the MCP Manager

Type /mcps in the TUI to open the MCP management dialog. It lists all configured servers with their current status:

  • ✓ Enabled — connected and active
  • ○ Disabled — configured but inactive

Keyboard shortcuts: space to toggle enable/disable, a to add a new server, Enter to act on the selected server.

Steps to Add a Local Server

  1. Press a (or select “Add MCP Server”) → choose Local
  2. Command — enter the command to start the server, e.g. npx my-mcp-server
  3. Environment variables (optional) — enter as KEY=VALUE, KEY2=VALUE2
  4. Server name — auto-derived from the command (lowercase, alphanumeric/hyphen/underscore); edit if needed
  5. Cyberstrike tests the connection before saving — if the connection fails, the server is not added and an error is shown; if it succeeds, the server is written to config

Config Written by TUI

~/.cyberstrike/config.json
{
"mcp": {
"my-local-server": {
"type": "local",
"command": ["npx", "my-mcp-server"],
"environment": { "KEY": "VALUE" }
}
}
}

Configuration

Basic Setup

~/.cyberstrike/config.json
{
"mcp": {
"servers": {
"my-tools": {
"command": "node",
"args": ["./mcp-server/index.js"]
}
}
}
}

Project-Level Configuration

cyberstrike.json
{
"mcp": {
"servers": {
"project-tools": {
"command": "python",
"args": ["-m", "project_mcp"]
}
}
}
}

Server Types

Node.js Servers

{
"mcp": {
"servers": {
"node-tools": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"]
}
}
}
}

Python Servers

{
"mcp": {
"servers": {
"python-tools": {
"command": "python",
"args": ["-m", "mcp_server"]
}
}
}
}

Binary Executables

{
"mcp": {
"servers": {
"binary-tools": {
"command": "/usr/local/bin/mcp-scanner"
}
}
}
}

Docker Containers

{
"mcp": {
"servers": {
"docker-tools": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp-tools:latest"]
}
}
}
}

Environment Variables

Pass to Server

{
"mcp": {
"servers": {
"api-tools": {
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "{env:MY_API_KEY}",
"DEBUG": "true"
}
}
}
}
}

Inherit Environment

{
"mcp": {
"servers": {
"tools": {
"command": "python",
"args": ["server.py"],
"inheritEnv": true
}
}
}
}

Working Directory

Set Working Directory

{
"mcp": {
"servers": {
"project-tools": {
"command": "node",
"args": ["server.js"],
"cwd": "/path/to/project"
}
}
}
}

Relative Paths

{
"mcp": {
"servers": {
"local-tools": {
"command": "./scripts/mcp-server.sh"
}
}
}
}

Filesystem Server

Access files and directories:

{
"mcp": {
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allow"]
}
}
}
}

SQLite Server

Query local databases:

{
"mcp": {
"servers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sqlite", "--db", "data.db"]
}
}
}
}

Git Server

Git operations:

{
"mcp": {
"servers": {
"git": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-git"]
}
}
}
}

Server Lifecycle

Startup

Servers start when:

  • Cyberstrike launches (if configured)
  • First tool from server is used (lazy start)

Auto-Start

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["server.js"],
"autoStart": true
}
}
}
}

Lazy Start

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["server.js"],
"autoStart": false
}
}
}
}

Restart on Failure

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["server.js"],
"restart": {
"enabled": true,
"maxRetries": 3,
"delay": 1000
}
}
}
}
}

Health Checks

Timeout Configuration

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["server.js"],
"timeout": 30000
}
}
}
}

Connection Verification

> Check MCP server status

Output:

MCP Server Status:
- my-tools: connected (5 tools)
- filesystem: connected (3 tools)
- sqlite: disconnected (starting...)

Resource Limits

Memory Limits

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["--max-old-space-size=512", "server.js"]
}
}
}
}

CPU Priority

{
"mcp": {
"servers": {
"tools": {
"command": "nice",
"args": ["-n", "10", "node", "server.js"]
}
}
}
}

Security Considerations

Sandboxing

{
"mcp": {
"servers": {
"untrusted": {
"command": "docker",
"args": ["run", "--rm", "-i", "--network=none", "mcp-server"]
}
}
}
}

Permission Restrictions

{
"mcp": {
"servers": {
"readonly": {
"command": "node",
"args": ["server.js"],
"permissions": {
"filesystem": "read",
"network": false
}
}
}
}
}

Debugging

Enable Logging

{
"mcp": {
"servers": {
"tools": {
"command": "node",
"args": ["server.js"],
"env": {
"DEBUG": "mcp:*"
}
}
}
}
}

View Logs

Terminal window
# Server logs location
tail -f ~/.cyberstrike/logs/mcp-my-tools.log

Manual Testing

Terminal window
# Test server directly
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node server.js

Troubleshooting

Server Not Starting

Error: Failed to start MCP server: my-tools

Check:

  • Command exists and is executable
  • Working directory is correct
  • Dependencies are installed

Connection Timeout

Error: MCP server connection timeout

Solutions:

  • Increase timeout value
  • Check server startup time
  • Verify server is responding

Tool Not Found

Error: Tool not found: my-tools/scanner

Verify:

  • Server is running
  • Tool is exported by server
  • Tool name is correct

Tip

Use lazy start for servers with slow startup times to avoid slowing down Cyberstrike launch.