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

# main
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%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%2Fmain%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/main.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F&text=main)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F&text=main)[Share on Bluesky](https://bsky.app/intent/compose?text=main%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F&title=main)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F&t=main)[Share on Email](mailto:?subject=main&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F)[Share on WhatsApp](https://wa.me/?text=main%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fmain%2F&text=main)
# `codeweaver.main`
[Section titled “codeweaver.main”](#codeweavermain)
Main FastMCP server entrypoint for CodeWeaver with linear bootstrap.

## Class: `UvicornAccessLogFilter`
[Section titled “Class: UvicornAccessLogFilter”](#class-uvicornaccesslogfilter)
Filter that blocks uvicorn access log messages.

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

**

```
filter()
```

Return False for uvicorn access logs to block them.

## Function: `get_stdio_server`
[Section titled “Function: get_stdio_server”](#function-get_stdio_server)

**

```
get_stdio_server()
```

Get a FastMCP stdio server setup for CodeWeaver.

Args: config_file: Optional path to configuration file. project_path: Optional path to project directory. host: Optional host for the server. This is the host/port for the *codeweaver http mcp server* that the stdio client will be proxied to. **You only need this if you’re not connecting to a default setting or not connecting to what is in your config file**. port: Optional port for the server. This is the host/port for the *codeweaver http mcp server* that the stdio client will be proxied to. **You only need this if you’re not connecting to a default setting or not connecting to what is in your config file**.

Returns: Configured FastMCP stdio server instance (not yet running).

## Function: `run`
[Section titled “Function: run”](#function-run)

**

```
run()
```

Run the CodeWeaver server with appropriate transport.

This is the main entry point for starting CodeWeaver’s MCP server.

Transport modes:

 - stdio (default): stdio proxy that forwards to the daemon’s HTTP backend. The daemon is started automatically if not already running.
 - streamable-http: Full server with background services, MCP HTTP server, and management server

For manual daemon control, use `codeweaver start` and `codeweaver stop`.

Args: config_file: Optional configuration file path project_path: Optional project directory path host: Host of HTTP backend to proxy to (stdio) or bind to (http) port: Port of HTTP backend to proxy to (stdio) or bind to (http) transport: Transport protocol (stdio or streamable-http) verbose: Enable verbose logging debug: Enable debug logging