miptgirl/mcp-analyst-toolkit
If you are the rightful owner of mcp-analyst-toolkit and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Analyst Toolkit is a server designed to provide data analysts and researchers with tools for accessing databases, change logs, and external APIs through the Model Context Protocol (MCP) interface.
execute_query
Execute SQL queries against ClickHouse databases.
get_databases
List all available databases.
get_table_schema
Get detailed schema information for specific tables.
MCP Analyst Toolkit
A Model Context Protocol (MCP) server that provides tools for data analysts and researchers. This server offers access to databases, change logs, and external APIs through the MCP interface.
Features
Database Integration
- ClickHouse Support: Execute queries against ClickHouse databases
- Database Discovery: List available databases and table schemas
- Query Templates: Pre-built query templates for common tasks
Data Resources
- Change Log Management: Access organizational change logs by time periods
- Historical Data: Track events and impacts across different quarters
- Structured Data Access: JSON-based change log data
Developer Tools
- GitHub Integration: Integration with GitHub repositories and APIs
- Extensible Architecture: Support for adding new tools and resources
- Type-Safe: Built with Python type hints
Installation
Prerequisites
- Python 3.11 or higher
- uv package manager (recommended)
Setup
-
Clone the repository:
git clone <repository-url> cd mcp-analyst-toolkit
-
Install dependencies:
uv pip install -e .
-
Run the MCP server:
uv run mcp dev src/mcp_server/server.py
The server will start and display:
- MCP Inspector URL for interactive testing
- Session token for authentication
- Server status and configuration
Usage
Running the Server
Start the MCP server in development mode:
uv run mcp dev src/mcp_server/server.py
Access the MCP Inspector at http://localhost:6274/
to explore available tools and resources.
Integration with Claude Code
Example of config to start using these tools in Claude Code.
{
"mcpServers": {
"analyst_toolkit": {
"command": "uv",
"args": [
"--directory",
"/path/to/repo/mcp-analyst-toolkit/src/mcp_server",
"run",
"server.py"
],
"env": {
"GITHUB_TOKEN": "your_github_token"
}
}
}
Available Tools
ClickHouse Database Tools
execute_query
: Execute SQL queries against ClickHouse databasesget_databases
: List all available databasesget_table_schema
: Get detailed schema information for specific tables
GitHub Tools
- Repository analysis and data extraction
- API integration for development workflows
Available Resources
Change Log Resources
changelog://periods
: List all available time periodschangelog://<period>
: Get detailed change logs for a specific period (e.g.,changelog://2025_q1
)
Example periods:
2025_q1
: Q1 2025 organizational changes2025_q2
: Q2 2025 organizational changes
Project Structure
src/
āāā mcp_server/
ā āāā __init__.py
ā āāā server.py # Main MCP server implementation
ā āāā prompts/
ā ā āāā __init__.py
ā ā āāā clickhouse_query.py # ClickHouse query templates
ā āāā resources/
ā ā āāā __init__.py
ā ā āāā change_log.py # Change log resource handlers
ā ā āāā change_log/ # Change log data files
ā ā āāā 2025_q1.json
ā ā āāā 2025_q2.json
ā ā āāā ...
ā āāā tools/
ā āāā __init__.py
ā āāā clickhouse.py # ClickHouse database tools
ā āāā github.py # GitHub integration tools
Configuration
Change Log Data
Change log data is stored in JSON format under src/mcp_server/resources/change_log/
. Each file represents a time period and contains structured event data:
[
{
"date": "2025-01-15",
"event": "New Year Collection Launch",
"impact": "Launched exclusive New Year fashion collection..."
}
]
Development
Adding New Tools
- Create a new tool module in
src/mcp_server/tools/
- Implement tool functions with proper type hints
- Register the tool in
src/mcp_server/server.py
Adding New Resources
- Create resource handlers in
src/mcp_server/resources/
- Add data files in appropriate subdirectories
- Register resources in the main server file
Testing
Verify functionality:
# Test the server startup
uv run mcp dev src/mcp_server/server.py
# Test specific components
uv run python -c "from mcp_server.resources.change_log import get_available_periods; print(get_available_periods())"
API Reference
Tools
execute_query(query: str, database: str = None)
Execute a SQL query against ClickHouse.
Parameters:
query
: SQL query stringdatabase
: Optional database name (uses default if not specified)
Returns: Query results as formatted data
get_databases()
List all available databases.
Returns: List of database names
get_table_schema(table_name: str, database: str = None)
Get schema information for a table.
Parameters:
table_name
: Name of the tabledatabase
: Optional database name
Returns: Table schema details
Resources
Change Log Resources
Access organizational change logs through URI-based resources:
changelog://periods
- List available periodschangelog://2025_q1
- Q1 2025 changeschangelog://2025_q2
- Q2 2025 changes
Contributing
- Fork the repository
- Create a feature branch
- Make your changes with proper type hints and documentation
- Test your changes thoroughly
- Submit a pull request
License
This project is licensed under the terms specified in the LICENSE file.
Support
For questions or issues, create an issue in the repository or refer to the MCP documentation.