Joseph M OBrien joe
  • Joined on 2026-03-15

personal-mcp (0.1.0)

Published 2026-05-31 14:29:22 -05:00 by joe

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add personal-mcp@0.1.0

About this package

personal-mcp

Lightweight personal MCP server built with the official Rust SDK (rmcp).

Features

  • host_info: quick local runtime context
  • append_note: append chat/note entries to local JSONL channels
  • read_notes: read recent entries from channels
  • run_cmd: run simple local commands (shell operators blocked)
  • baml_test: run baml-cli test (or bunx @boundaryml/baml test)
  • baml_generate: run baml-cli generate (or bunx @boundaryml/baml generate)
  • baml_init: run baml-cli init (or bunx @boundaryml/baml init)
  • baml_analyze_log: one-shot log analysis via local baml serve + HTTP function call
  • baml_analyze_log_stream: stream partial structured log analysis from /stream/*

Storage

  • Default context root: ~/.ctx
  • Notes path: ~/.ctx/chats/<channel>.jsonl
  • Override with MCP_CTX_DIR=/custom/path

Run

cd ~/dev/personal-mcp
cargo run

Server uses MCP stdio transport.

Build

cargo build --release

Binary:

./target/release/personal-mcp

BAML integration

The server will try BAML CLI in this order:

  1. baml-cli
  2. bunx --yes @boundaryml/baml

Examples (through MCP tool calls):

  • baml_init with { "cwd": "/path/to/project" }
  • baml_generate with { "cwd": "/path/to/project" }
  • baml_test with { "cwd": "/path/to/project", "args": ["--from", "."] }
  • baml_analyze_log with { "cwd": "/path/to/project", "log_text": "...raw log..." }

Log parsing scaffold

This repo now includes a BAML scaffold under baml_src:

  • AnalyzeLogEvent(log_text: string) -> LogEvent
  • SummarizeIncident(log_lines: string[]) -> IncidentSummary
  • Semantic streaming annotations (@stream.done, @stream.not_null, @stream.with_state)

Helper script:

./scripts/baml-log-lab.sh generate
./scripts/baml-log-lab.sh test
./scripts/baml-log-lab.sh serve
./scripts/baml-log-lab.sh dev
./scripts/baml-log-lab.sh analyze-file ./samples/auth-db-failure.log
./scripts/baml-log-lab.sh stream-file ./samples/auth-db-failure.log

Scaffold generator (profile-driven baml_src):

./scripts/baml-scaffold.sh --profile log-analysis --force
./scripts/baml-scaffold.sh --profile extraction --model gpt-5 --force
./scripts/baml-scaffold.sh --profile classify --force
./scripts/baml-scaffold.sh --profile minimal --force

Profiles:

  • log-analysis: streaming-friendly log parsing schema/functions
  • extraction: structured resume extraction scaffold
  • classify: category classification scaffold
  • minimal: tiny starter scaffold

Notes:

  • The scaffold writes generators.baml with a version matching your installed baml-cli (fallback 0.219.0).

Equivalent mise tasks:

mise run baml-generate
mise run baml-scaffold                  # default BAML_PROFILE=log-analysis
BAML_PROFILE=classify mise run baml-scaffold
mise run baml-test
mise run baml-serve
mise run baml-dev
mise run baml-stream-sample

Runtime logging defaults:

  • BAML_LOG=info
  • BOUNDARY_MAX_LOG_CHUNK_CHARS=3000

You can override per run:

BAML_LOG=debug BOUNDARY_MAX_LOG_CHUNK_CHARS=1000 \
  ./scripts/baml-log-lab.sh stream-file ./samples/auth-db-failure.log

Notes:

  • BAML streaming and REST/OpenAPI interfaces are preview features.
  • Use BAML version >=0.55 for this flow.
  • dev --preview exposes:
    • health route: http://127.0.0.1:2024/_debug/ping
    • docs route: http://127.0.0.1:2024/docs

Environment variables

  • OPENAI_API_KEY (required): used by baml_src/clients.baml via env.OPENAI_API_KEY
  • BOUNDARY_API_KEY (optional): enables Boundary Studio traces/logs
  • BAML_LOG (optional, default info)
  • BOUNDARY_MAX_LOG_CHUNK_CHARS (optional, default 3000)

Setup:

cp .env.example .env
# fill OPENAI_API_KEY and optional BOUNDARY_API_KEY

scripts/baml-log-lab.sh auto-loads ./.env if present and fails fast if OPENAI_API_KEY is missing.

Claude Desktop MCP config example

{
  "mcpServers": {
    "personal": {
      "command": "/Users/rentamac/dev/personal-mcp/target/release/personal-mcp",
      "env": {
        "MCP_CTX_DIR": "/Users/rentamac/.ctx"
      }
    }
  }
}

Dependencies

ID Version
anyhow ^1.0
bytes ^1
claude-agent-sdk-rs ^0.6.4
hostname ^0.4
llm ^1.3.7
progenitor-client ^0.13
reqwest ^0.13
rmcp ^0.16
serde ^1.0
serde_json ^1.0
shlex ^1
tokio ^1.48
openapiv3 ^2
prettyplease ^0.2
progenitor ^0.13
serde_yaml ^0.9
syn ^2
Details
Cargo
2026-05-31 14:29:22 -05:00
2
67 KiB
Assets (1)
Versions (1) View all
0.1.0 2026-05-31