mcpserver

package
v0.0.0-...-840b2b7 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcpserver exposes the Gnar engine as an MCP server over stdio so any agent or IDE that speaks the Model Context Protocol can share one memory.

IMPORTANT: the stdio transport owns stdout for JSON-RPC framing. Never write to stdout here — log to stderr only.

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.1.0"

Version is the reported server version (overridable via -ldflags -X).

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server bundles the engine with a default working directory used for project auto-detection when a tool call omits an explicit project.

func New

func New(eng *engine.Engine, dir string) *Server

New creates an MCP server over the given engine. dir is the default directory for project detection (typically the process working directory).

func (*Server) Build

func (s *Server) Build() *mcp.Server

Build constructs the underlying MCP server with all tools, resources, and prompts registered. Exposed so tests can attach an in-memory transport.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run serves over stdio until the client disconnects.

Jump to

Keyboard shortcuts

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