This project provides a MCP (Magic Copy Paste) integration for Basecamp 3, allowing Cursor to interact with Basecamp directly through the MCP protocol.
## Architecture
The project consists of the following components:
1.**OAuth App** (`oauth_app.py`) - A Flask application that handles the OAuth 2.0 flow with Basecamp.
2.**Token Storage** (`token_storage.py`) - A module for securely storing OAuth tokens.
3.**MCP Server** (`mcp_server.py`) - A Flask server that implements the MCP protocol for Basecamp.
4.**Basecamp Client** (`basecamp_client.py`) - A client library for interacting with the Basecamp API.
5.**Basecamp OAuth** (`basecamp_oauth.py`) - A utility for handling OAuth authentication with Basecamp.
6.**Search Utilities** (`search_utils.py`) - Utilities for searching Basecamp resources.
## Setup
### Prerequisites
- Python 3.7+
- A Basecamp 3 account
- A Basecamp OAuth application (create one at https://launchpad.37signals.com/integrations)
### Installation
1. Clone this repository:
```
git clone <repository-url>
cd basecamp-mcp
```
2. Create and activate a virtual environment:
```
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```
pip install -r requirements.txt
```
4. Create a `.env` file with the following variables:
1. In Cursor, add the MCP server URL: `http://localhost:5001/mcp/stream`
- **Note:** This URL points to the new Server-Sent Events (SSE) endpoint. Cursor may prefer this for real-time updates and for features like `ListOfferings` that stream data.
- If you encounter issues, Cursor might alternatively try to use the base URL (`http://localhost:5001`) to first query `/mcp/info` (to discover available actions and endpoints) and then connect to the appropriate endpoint as indicated there.
2. Interact with Basecamp through the Cursor interface.
3. The MCP server will use the stored OAuth token to authenticate with Basecamp.
These changes ensure more reliable and consistent responses from the MCP server, particularly for Campfire chat functionality.
### March 9, 2024 - Added Composio Integration
Added support for [Composio](https://composio.dev/) integration, allowing the Basecamp MCP server to be used with Composio for AI-powered workflows. This integration follows the Model Context Protocol (MCP) standards and includes:
- New endpoints for Composio compatibility:
-`/composio/schema` - Returns the schema of available tools in Composio-compatible format
-`/composio/tool` - Handles Composio tool calls with standardized parameters
-`/composio/check_auth` - Checks authentication status for Composio requests
- Standardized tool naming and parameter formats to work with Composio's MCP specifications
- A standalone example client for testing and demonstrating the integration
## Using with Composio
### Prerequisites
1. Create a Composio account at [https://app.composio.dev](https://app.composio.dev)
2. Obtain a Composio API key from your Composio dashboard
3. Add your API key to your `.env` file:
```
COMPOSIO_API_KEY=your_composio_api_key
```
### Setting Up Composio Integration
1. Make sure you have authenticated with Basecamp using the OAuth app (http://localhost:8000/)
2. Run the MCP server with the Composio integration enabled:
```
python mcp_server.py
```
3. In your Composio dashboard, add a new custom integration: