This guide provides information for developers who want to extend or modify the MCP servers in this repository.
The repository is organized as follows:
mcp-security/
├── docs/ # Documentation
│ ├── servers/ # Server-specific documentation
│ └── img/ # Images for documentation
├── run-with-google-adk/ # Autonomous SOC Agent (Google ADK v2 & MCP)
│ ├── src/ # Package source (mcp_security_agent)
│ ├── static/ # Web UI frontend assets
│ └── tests/ # Hermetic unit test suite
├── server/ # Server implementations
│ ├── gti/ # Google Threat Intelligence server
│ ├── scc/ # Security Command Center server
│ ├── secops/ # Security Operations server
│ └── secops-soar/ # SOAR server
└── README.md # Repository README
Each MCP server follows a similar structure:
- Server Entry Point: The main server script that handles MCP protocol interactions
- Tools Module: Contains the functions exposed as MCP tools
- Utilities: Helper functions and API clients
server/gti/
├── gti_mcp/ # Main package
│ ├── server.py # MCP server implementation
│ ├── utils.py # Utility functions
│ └── tools/ # Tool implementations
│ ├── __init__.py
│ ├── collections.py
│ ├── files.py
│ └── ...
├── pyproject.toml # Project metadata
├── setup.py # Installation script
└── README.md # Server-specific README
To add a new tool to an existing server:
- Identify the appropriate server and tools module
- Add your tool function with proper type annotations
- Register the tool in the server's tool registry
- Update the documentation in the corresponding
docs/servers/*.mdfile
# In server/gti/gti_mcp/tools/files.py
def new_file_tool(file_hash: str) -> dict:
"""
Description of what the new tool does.
Args:
file_hash: Description of the parameter
Returns:
A dictionary containing the relevant information
"""
# Implementation goes here
...
return resultThen register it in __init__.py:
from .files import get_file_report, get_entities_related_to_a_file, new_file_tool
__all__ = [
"get_file_report",
"get_entities_related_to_a_file",
"new_file_tool"
]To create a new MCP server:
- Create a new directory under
server/ - Implement the server following the MCP specification
- Create appropriate documentation in
docs/servers/ - Update the table of contents in
docs/toc.md
For each server, you should test:
- Tool Functionality: Ensure each tool works as expected
- MCP Protocol Compliance: Test compatibility with MCP clients
- Error Handling: Verify graceful error handling
When documenting tools:
- Include clear descriptions of what each tool does
- Document all parameters with types and descriptions
- Explain the return values and any side effects
- Provide examples of how to use the tool
The documentation uses Sphinx with MyST Markdown. To build the docs:
-
Install dependencies:
cd docs pip install -r requirements.txt -
Build the documentation:
make html
-
The built documentation will be in
docs/_build/html/
- Fork the repository
- Create a feature branch
- Make your changes
- Update documentation
- Submit a pull request
- Follow Python PEP 8 style guidelines
- Add type annotations to all functions
- Write clear docstrings
- Handle errors gracefully
- Keep MCP tools focused on a single responsibility