home / mcp / access context mcp server
MCP Server generated by mcp.ag2.ai
Configuration
View docs{
"mcpServers": {
"ag2-mcp-servers-access-context-manager-api": {
"command": "python",
"args": [
"mcp_server/main.py",
"stdio"
],
"env": {
"CONFIG": "{...}",
"SECURITY": "{...}",
"CONFIG_PATH": "mcp_server/mcp_config.json"
}
}
}
}You run an MCP (Model Context Protocol) server to expose a specific API context over a flexible transport. This server lets you connect an MCP client to a locally hosted instance that can operate in different transport modes, such as stdio or HTTP streaming, enabling you to test, develop, and integrate with the target API smoothly.
Use an MCP client to connect to your local MCP server. The server supports multiple transport modes; choose stdio for direct process-based communication during development, or select streaming transports like sse or streamable-http when your environment requires it. Start the server in the chosen mode and then point your MCP client at the running instance using the appropriate transport configuration. You will typically provide a configuration object that identifies the MCP server, transport mode, and any needed environment parameters. As you interact, you can exercise API calls, fetch contextual data, and validate responses within your local development setup.
# Prerequisites
# Ensure you have Python 3.9+ installed and available as `python3` or `python` on your PATH.
# The runtime also requires pip and the uv runtime utility to run the server.
# Step 1: Clone the repository
git clone <repository-url>
cd mcp-server
# Step 2: Install dependencies
# If you are using the development container setup, dependencies are installed via
# the dedicated script. Otherwise, install manually:
pip install -e ".[dev]"
# Alternatively, you can use uv to run the installation step:
uv pip install --editable ".[dev]"
# Step 3: Run the server in stdio mode
python mcp_server/main.py stdio
# Optional: Use environment variables to customize startup
export CONFIG_PATH=mcp_server/mcp_config.json
export CONFIG="{...}"
export SECURITY="{...}"
# Step 4: Verify the server starts and awaits MCP client connections
```
"}]},{Note the project uses Hatch for building and publishing, and script utilities handle linting, static analysis, and tests. You can run the following workflows to ensure code quality and test coverage during development.
Environment variables that influence the MCP server runtime are provided to configure behavior and security. The following variables are commonly used: - CONFIG_PATH: Path to a JSON configuration file (for example, mcp_server/mcp_config.json). - CONFIG: A JSON string containing the configuration inline. - SECURITY: Environment variables that supply security-related parameters, such as API keys or tokens.
Ruff is used for linting and formatting to ensure code quality and consistency.
Ruff format ensures code formatting is consistent with project standards.
Mypy performs static type checking to catch type errors early.
Pytest is used to run tests and generate coverage reports.
A static analysis script runs tools like mypy, bandit, and semgrep for security and quality checks.
Hatch builds the project for distribution and publishing.
Hatch publishes the built package to the configured package index.