server

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package server wires the Model Context Protocol server.

Responsibilities:

  • Build an mcp-go server (github.com/mark3labs/mcp-go) over stdio.
  • Register every tl_* tool with its JSON schema, description, and handler.
  • Translate handler errors into MCP error envelopes the client can render.
  • Own the lifecycle: graceful shutdown on SIGINT/SIGTERM, structured logs to stderr (stdio is reserved for the protocol).

What does NOT belong here:

  • SQL or storage implementation — that lives in internal/storage.
  • Domain types or validation — that lives in internal/memory.

The split is deliberate: server is a thin adapter. Tool handlers should be at most a few dozen lines each, delegating to storage and returning a formatted MCP response.

Status: skeleton. Real wiring lands in milestone M1 alongside tl_save.

Package server wires the Model Context Protocol server.

New() builds an mcp-go MCPServer pre-registered with every tl_* tool and returns it. The caller (cmd/thoughtline) is responsible for actually running the stdio transport via server.ServeStdio.

Index

Constants

View Source
const AllProjectsSentinel = "*"

AllProjectsSentinel is the special Project value that opts out of the default-project filter. Documented in the tool description.

Variables

This section is empty.

Functions

func New

func New(s *storage.Storage, cfg Config) *server.MCPServer

New constructs an MCPServer with all Thoughtline tools registered.

Types

type Config

type Config struct {
	Version        string
	DefaultProject string
}

Config knobs for the server. Project is the fallback project identifier used when a tool call omits the `project` argument; in production it resolves to the basename of the working directory at boot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL