---
title: mcp | CodeWeaver Docs
description: API reference for codeweaver.server.config.mcp
url: "https://docs.knitli.com/api/server/config/mcp"
type: static
generatedAt: "2026-04-17T17:21:09.738Z"
---

# mcp
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/server/config/mcp.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F&text=mcp)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F&text=mcp)[Share on Bluesky](https://bsky.app/intent/compose?text=mcp%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F&title=mcp)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F&t=mcp)[Share on Email](mailto:?subject=mcp&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F)[Share on WhatsApp](https://wa.me/?text=mcp%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fserver%2Fconfig%2Fmcp%2F&text=mcp)
# `codeweaver.server.config.mcp`
[Section titled “codeweaver.server.config.mcp”](#codeweaverserverconfigmcp)
Configuration Models for mcp.json-type configuration files.

These are wrappers around FastMCP’s configuration models, adding CodeWeaver defaults and types where appropriate.

## MCP Transports
[Section titled “MCP Transports”](#mcp-transports)
CodeWeaver supports two MCP transports: STDIO (default) and HTTP streaming.

## Architecture: STDIO with HTTP Backend
[Section titled “Architecture: STDIO with HTTP Backend”](#architecture-stdio-with-http-backend)
CodeWeaver uses a daemon architecture that provides the best of both worlds:

 1. **Daemon** (`codeweaver start`): Runs background services as a persistent process

 - Background indexing and file watching
 - HTTP MCP server on port 9328
 - Management server on port 9329
 1. **STDIO Transport** (default): MCP clients spawn stdio processes that proxy to the daemon

 - Compatible with all MCP clients (Claude Desktop, VS Code, etc.)
 - Each stdio process is lightweight - just a proxy to the HTTP backend
 - All clients share the same indexed codebase via the daemon

This architecture enables:

 - **Universal compatibility**: STDIO works with any MCP client
 - **Shared state**: All clients access the same index via the HTTP backend
 - **Background indexing**: The daemon keeps your index up to date between sessions
 - **Concurrent access**: Multiple clients can connect simultaneously
 - **Resource efficiency**: One daemon serves all clients

## When to Use HTTP Transport Directly
[Section titled “When to Use HTTP Transport Directly”](#when-to-use-http-transport-directly)
Use `--transport streamable-http` when:

 - Running CodeWeaver as a standalone service (e.g., in Docker)
 - Connecting from clients that support HTTP transport natively
 - You don’t need STDIO compatibility

## Quick Start
[Section titled “Quick Start”](#quick-start)

*Terminal window*

```
# Start the daemon (runs HTTP backend + background services)codeweaver start
# MCP clients will automatically use STDIO transport to connect to the daemon# Or run STDIO server manually:codeweaver server  # defaults to --transport stdio
```

## Class: `CodeWeaverMCPConfig`
[Section titled “Class: CodeWeaverMCPConfig”](#class-codeweavermcpconfig)
Configuration model for CodeWeaver configuration in mcp.json files.

### Method: `as_mcp_config`
[Section titled “Method: as_mcp_config”](#method-as_mcp_config)

**

```
as_mcp_config()
```

Serialize the configuration to a dictionary suitable for MCP config files.

Returns: A dictionary representation of the CodeWeaver MCP configuration.

## Class: `MCPConfig`
[Section titled “Class: MCPConfig”](#class-mcpconfig)
Configuration model for mcp.json files.

Represents the overall MCP configuration, including CodeWeaver-specific settings.

### Method: `from_vscode`
[Section titled “Method: from_vscode”](#method-from_vscode)

**

```
from_vscode()
```

Validate the configuration for use in VSCode settings.

Raises: ValueError: If the configuration is invalid for VSCode.

### Method: `serialize_for_vscode`
[Section titled “Method: serialize_for_vscode”](#method-serialize_for_vscode)

**

```
serialize_for_vscode()
```

Serialize the configuration for use in VSCode settings.

Returns: A dictionary representation of the configuration suitable for VSCode.

## Class: `StdioCodeWeaverConfig`
[Section titled “Class: StdioCodeWeaverConfig”](#class-stdiocodeweaverconfig)
Configuration model for CodeWeaver mcp.json files using stdio communication (default).

### Method: `as_mcp_config`
[Section titled “Method: as_mcp_config”](#method-as_mcp_config-1)

**

```
as_mcp_config()
```

Serialize the configuration to a dictionary suitable for MCP config files.

Returns: A dictionary representation of the CodeWeaver MCP configuration.