tenets.mcp Package¶
Tenets MCP Server - Model Context Protocol integration.
This module provides an MCP server that exposes tenets functionality to AI coding assistants like Cursor, Claude Desktop, Windsurf, and custom agents.
The MCP server wraps the existing tenets core library, providing: - Tools: Actions AI can invoke (distill, rank, examine, etc.) - Resources: Data AI can read (context history, session state, analysis) - Prompts: Reusable interaction templates
Usage
Start the MCP server (stdio transport for local IDE integration)¶
$ tenets-mcp
Or with specific transport¶
$ tenets-mcp --transport stdio # Local (default) $ tenets-mcp --transport sse # Server-Sent Events $ tenets-mcp --transport http # Streamable HTTP
Programmatic usage¶
from tenets.mcp import create_server server = create_server() server.run(transport="stdio")
Configuration
MCP settings can be configured in .tenets.yml:
Example IDE Configuration (Claude Desktop):
Classes¶
TenetsMCP¶
TenetsMCP(name: str = 'tenets', config: Optional[TenetsConfig] = None, project_path: Optional[Path] = None)
Tenets MCP Server.
Wraps the tenets core library and exposes functionality via MCP protocol. This class manages the FastMCP server instance and handles lifecycle.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name | Server name for MCP identification. |
tenets | Underlying Tenets instance for actual functionality. TYPE: |
config | Configuration for the MCP server. TYPE: |
Example
from tenets.mcp import TenetsMCP server = TenetsMCP() server.run(transport="stdio")
Initialize the MCP server.
| PARAMETER | DESCRIPTION |
|---|---|
name | Server name shown to MCP clients. TYPE: |
config | Optional TenetsConfig. If not provided, uses defaults. TYPE: |
project_path | Optional project root path. Defaults to cwd. |
Attributes¶
nameinstance-attribute¶
Functions¶
run¶
run(transport: Literal['stdio', 'sse', 'http'] = 'stdio', host: str = '127.0.0.1', port: int = 8080) -> None
Run the MCP server with the specified transport.
| PARAMETER | DESCRIPTION |
|---|---|
transport | Transport type - stdio (local), sse, or http (remote). TYPE: |
host | Host for network transports (sse, http). TYPE: |
port | Port for network transports (sse, http). TYPE: |
Functions¶
create_server¶
Create a new Tenets MCP server instance.
Factory function for creating MCP servers. This is the recommended way to instantiate the server for programmatic use.
| PARAMETER | DESCRIPTION |
|---|---|
name | Server name shown to MCP clients. TYPE: |
config | Optional TenetsConfig for customization. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TenetsMCP | Configured TenetsMCP instance ready to run. |
Example
from tenets.mcp import create_server server = create_server() server.run(transport="stdio")
main¶
CLI entry point for tenets-mcp server.
Parses command-line arguments and starts the MCP server with the specified transport configuration.
Modules¶
server- Server module