MCP server for interacting with Quip spreadsheets
Project description
Quip MCP Server
A Model Context Protocol (MCP) server for interacting with Quip spreadsheets. This server provides tools to read spreadsheet data from Quip documents and return the content in CSV format.
Features
- Retrieve spreadsheet content from Quip documents
- Support for selecting specific sheets by name
- Returns data in CSV format
- Handles authentication via Quip API token
- Provides appropriate error messages for non-spreadsheet documents
Installation
Using uvx (recommended)
When using uv, no specific installation is needed. We will use uvx to directly run the server:
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Run the server directly with uvx
uvx quip-mcp-server
Using pip
Alternatively, you can install the package via pip:
pip install quip-mcp-server
After installation, you can run it as a script:
python -m src.server
Set up environment variables
Set up the required environment variables:
export QUIP_TOKEN=your_quip_api_token
export QUIP_BASE_URL=https://platform.quip.com # Optional, defaults to this value
Alternatively, create a .env file in the root directory:
QUIP_TOKEN=your_quip_api_token
QUIP_BASE_URL=https://platform.quip.com
Usage
Configure for Claude.app
Add to your Claude settings:
"mcpServers": {
"quip": {
"command": "uvx",
"args": ["quip-mcp-server"],
"env": {
"QUIP_TOKEN": "your_quip_api_token"
}
}
}
Running the Server Manually
Run the server directly:
# Using uvx (recommended)
uvx quip-mcp-server
# Using python (if installed via pip)
python -m src.server
Available Tools
quip_read_spreadsheet
Retrieves the content of a Quip spreadsheet as CSV.
Parameters:
threadId(required): The Quip document thread IDsheetName(optional): Name of the sheet to extract. If not provided, the first sheet will be used.
Example:
{
"threadId": "AbCdEfGhIjKl",
"sheetName": "Sheet1"
}
Response: The tool returns the spreadsheet content in CSV format.
Error Handling:
- If the thread is not a spreadsheet, an error will be returned.
- If the specified sheet is not found, an error will be returned.
How It Works
The server uses two methods to extract spreadsheet data:
- Primary Method: Exports the spreadsheet to XLSX format using the Quip API, then converts it to CSV.
- Fallback Method: If the primary method fails, it parses the HTML content of the document to extract the table data.
Development
Project Structure
quip-mcp-server/
├── src/
│ ├── __init__.py
│ ├── server.py # Main MCP server implementation
│ ├── quip_client.py # Quip API client
│ └── tools.py # Tool definitions and handlers
├── tests/
│ ├── __init__.py
│ ├── test_server.py # Unit tests for the server
│ └── e2e/ # End-to-end tests
│ ├── __init__.py
│ ├── conftest.py # Test fixtures for e2e tests
│ └── test_quip_integration.py # Integration tests with Quip API
├── .uv/
│ └── config.toml # uv configuration settings
├── pyproject.toml # Project metadata and dependencies (includes pytest config)
├── uvproject.yaml # uv-specific project configuration
├── uv.lock # Locked dependencies
├── .python-version # Python version specification
├── .env.example # Example environment variables
├── LICENSE # MIT License
└── README.md # Documentation
Development with uv
This project uses uv for dependency management. uv is a fast Python package installer and resolver that can replace pip and virtualenv.
Configuration Files
pyproject.toml: Standard Python packaging configurationuvproject.yaml: uv-specific project configuration.uv/config.toml: uv configuration settings.python-version: Specifies Python 3.12 as the project's Python version (used by pyenv and other version managers)
Setting Up a Development Environment
To set up a development environment:
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a virtual environment and install dependencies
uv venv
uv pip install -e .
# Install development dependencies
uv pip install pytest black isort mypy
Alternatively, you can use the uvproject.yaml file:
# Install dependencies from uvproject.yaml
uv pip sync
Running the Server with uv
# Using uvx (recommended for development)
uvx quip-mcp-server
# Or, if you're using a virtual environment:
# Activate the virtual environment (if not auto-activated)
source .venv/bin/activate
# Run the server
python -m src.server
Running Tests
The project uses pytest for testing. To run the tests:
# Install development dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=src
# Run only e2e tests
pytest tests/e2e
# Run a specific e2e test
pytest tests/e2e/test_quip_integration.py::test_connection
End-to-End (e2e) Testing
The project includes end-to-end tests that verify integration with the actual Quip API. To run these tests:
-
Create a
.env.localfile in the project root with your test configuration:# Quip API token (required) QUIP_TOKEN=your_actual_quip_token_here # Test configuration TEST_THREAD_ID=your_test_spreadsheet_thread_id TEST_SHEET_NAME=Sheet1 # Optional: specific sheet name to test -
Run the e2e tests:
# Run all e2e tests pytest tests/e2e # Run with verbose output pytest -v tests/e2e
Note: The e2e tests will be skipped automatically if .env.local is missing or if required environment variables are not set.
#### Debugging
You can use the MCP inspector to debug the server:
```bash
# For uvx installations
npx @modelcontextprotocol/inspector uvx quip-mcp-server
# Or if you're developing locally
cd /path/to/quip-mcp-server
npx @modelcontextprotocol/inspector uv run src.server
Adding New Tools
To add new tools:
- Define the tool in
src/tools.pyby adding it to theget_quip_tools()function. - Implement the handler function for the tool.
- Register the handler in
src/server.pyby adding it to thecall_tool()function.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quip_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: quip_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c2d04e62313402cc3de7dfef8835b27ae469604cebe9d450a79a15cfded7a36
|
|
| MD5 |
e9add1f6c2447bceb895fa7de7278296
|
|
| BLAKE2b-256 |
478a686485a8cabedf32edb94e97fb0a376dfaf6500f461fa16b12d83eba70b4
|
Provenance
The following attestation bundles were made for quip_mcp_server-0.1.0.tar.gz:
Publisher:
release.yml on zxkane/quip-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quip_mcp_server-0.1.0.tar.gz -
Subject digest:
3c2d04e62313402cc3de7dfef8835b27ae469604cebe9d450a79a15cfded7a36 - Sigstore transparency entry: 194289041
- Sigstore integration time:
-
Permalink:
zxkane/quip-mcp-server@d329a70ed7a6ca60ea5e270a4f4f135f5d60d4ff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zxkane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d329a70ed7a6ca60ea5e270a4f4f135f5d60d4ff -
Trigger Event:
push
-
Statement type:
File details
Details for the file quip_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: quip_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bab4c5a7f32dabedd39324598260cdf289e7ed903333983a32527ce3a4a2ca6
|
|
| MD5 |
8ea235f4a092aa0825cb906e79a4e69c
|
|
| BLAKE2b-256 |
2ee280b68305b4c061a30ebcf258936a15da7df9f1fecd64faa12214fabdd241
|
Provenance
The following attestation bundles were made for quip_mcp_server-0.1.0-py3-none-any.whl:
Publisher:
release.yml on zxkane/quip-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quip_mcp_server-0.1.0-py3-none-any.whl -
Subject digest:
4bab4c5a7f32dabedd39324598260cdf289e7ed903333983a32527ce3a4a2ca6 - Sigstore transparency entry: 194289042
- Sigstore integration time:
-
Permalink:
zxkane/quip-mcp-server@d329a70ed7a6ca60ea5e270a4f4f135f5d60d4ff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zxkane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d329a70ed7a6ca60ea5e270a4f4f135f5d60d4ff -
Trigger Event:
push
-
Statement type: