Factors.ai MCP server — agent management and execution tools
Project description
factors-mcp-v2
Python package exposing a Model Context Protocol (MCP) server for Factors.ai — list/create/update agents, run agents against domains, and use bundled prompt guidelines.
Requirements
- Python 3.10+
- A Factors private API token (
FACTORS_API_KEY) with access to the Factors API (FACTORS_API_URL)
Install
From the wheel (built locally)
cd factors_mcp_v2
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install dist/factors_mcp_v2-0.1.0-py3-none-any.whl
(Replace the wheel filename with the version produced under dist/.)
Editable install (development)
cd factors_mcp_v2
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
The factors-mcp-v2 console script is installed on your PATH.
Client configuration (Claude Desktop & Cursor)
Both clients drive the server over stdio. Point them at the Python interpreter or console script from the same virtualenv where you installed factors-mcp-v2, and pass your API credentials in env (do not commit real keys into shared project files).
Claude Desktop
- Quit Claude Desktop completely.
- Open the config file in a text editor:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Merge the
mcpServersentry below with any existingmcpServersobject (do not remove other servers).
{
"mcpServers": {
"factors-ai": {
"command": "/absolute/path/to/your/.venv/bin/python",
"args": ["-m", "factors_mcp_v2"],
"env": {
"FACTORS_API_KEY": "your_private_token",
"FACTORS_API_URL": "https://api.factors.ai"
}
}
}
}
Alternatively, if factors-mcp-v2 is on your PATH inside that venv:
{
"mcpServers": {
"factors-ai": {
"command": "/absolute/path/to/your/.venv/bin/factors-mcp-v2",
"args": [],
"env": {
"FACTORS_API_KEY": "your_private_token",
"FACTORS_API_URL": "https://api.factors.ai"
}
}
}
}
Restart Claude Desktop after saving.
Cursor
- Create or edit an MCP config file (JSON):
- Project:
<repo-root>/.cursor/mcp.json(optional; share with the team without secrets) - User-wide:
~/.cursor/mcp.json(macOS/Linux) or%USERPROFILE%\.cursor\mcp.json(Windows)
- Project:
- Add a
mcpServersentry (merge with existing servers if the file already exists).
{
"mcpServers": {
"factors-ai": {
"command": "/absolute/path/to/your/.venv/bin/python",
"args": ["-m", "factors_mcp_v2"],
"env": {
"FACTORS_API_KEY": "your_private_token",
"FACTORS_API_URL": "https://api.factors.ai"
}
}
}
}
Fully restart Cursor after changing MCP configuration so it reloads the server list.
Tip: Use absolute paths to python or factors-mcp-v2 so the client does not pick up a different interpreter than the one where the package is installed.
Build the wheel
From this directory (factors_mcp_v2):
python -m venv .venv
source .venv/bin/activate
pip install build
python -m build
Artifacts appear under dist/:
factors_mcp_v2-<version>-py3-none-any.whlfactors_mcp_v2-<version>.tar.gz(sdist)
Run the MCP server
1. After installing the package (recommended)
export FACTORS_API_KEY=your_private_token
export FACTORS_API_URL=https://api.factors.ai # optional; default shown
# Default transport is stdio (typical for Cursor / Claude Desktop)
factors-mcp-v2
Or:
python -m factors_mcp_v2
2. SSE over HTTP (remote / Docker-style)
The underlying FastMCP server supports transport="sse". Set env vars and use the entry point; if you need SSE explicitly, run the same module with a small wrapper or extend main() in server.py to pass transport="sse" and host/port as needed.
For local Docker builds, the repo may use a Dockerfile that sets FASTMCP_HOST / FASTMCP_PORT and runs the server.
3. Run from the repo without installing (development only)
You must put the package on PYTHONPATH so factors_mcp_v2 imports resolve:
cd factors_mcp_v2
export PYTHONPATH=src
export FACTORS_API_KEY=your_private_token
python src/factors_mcp_v2/server.py
Prefer pip install -e . and factors-mcp-v2 or python -m factors_mcp_v2 instead.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
FACTORS_API_KEY |
(required) | Private project token (Authorization header to /mcp/afx/*) |
FACTORS_API_URL |
https://api.factors.ai |
Base URL of the Factors API |
FACTORS_BEARER_TOKEN |
(empty) | Optional; reserved for future use |
FACTORS_SESSION_TOKEN |
(empty) | Optional session-related env |
Package layout
factors_mcp_v2/
pyproject.toml
README.md
requirements.txt
src/
factors_mcp_v2/
__init__.py
__main__.py
server.py # MCP server (FastMCP tools, resources, prompts)
utils.py
AGENT_PROMPT_GUIDELINES.md
License
Proprietary — Factors.ai internal use unless otherwise stated.
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 factors_mcp_v2-0.1.0.tar.gz.
File metadata
- Download URL: factors_mcp_v2-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4edace2c65deea89d1a2491a8ded2f3324bc32fb254fbe3d797e1e2bf2512950
|
|
| MD5 |
59b12a22eb5c5d4e439e896e9ee08509
|
|
| BLAKE2b-256 |
8dd7f095bf11effcf01fc6e7f50f9543ff1ece0c5202a602e921918e5c705302
|
File details
Details for the file factors_mcp_v2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: factors_mcp_v2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a63b6cb23e9fe7be81f6b2a782fa44797d50cc4a2b45977d5d7366c4895a095
|
|
| MD5 |
6769db7013811b071fb783670f824f65
|
|
| BLAKE2b-256 |
eeca0088b06c53796b36400de0902c55be550855b54414052421fa59ab085177
|