Core Components

This section documents the core components of mcpcap that handle configuration and server management.

Configuration Management

Configuration management for mcpcap.

class mcpcap.core.config.Config(modules=None, max_packets=None, transport='stdio', host='127.0.0.1', port=8080)[source]

Bases: object

Configuration management for mcpcap server.

__init__(modules=None, max_packets=None, transport='stdio', host='127.0.0.1', port=8080)[source]

Initialize configuration.

Parameters:
  • modules (list[str] | None) – List of modules to load

  • max_packets (int | None) – Maximum number of packets to analyze per file

  • transport (str) – Transport type (‘stdio’ or ‘http’)

  • host (str) – Host to bind to (for HTTP transport)

  • port (int) – Port to bind to (for HTTP transport)

MCP Server

MCP server setup and configuration.

class mcpcap.core.server.MCPServer(config)[source]

Bases: object

MCP server for PCAP analysis.

__init__(config)[source]

Initialize MCP server.

Parameters:

config (Config) – Configuration instance

run()[source]

Start the MCP server.

Return type:

None