org-mcp-server
CLAUDE.md42 starsChanged 5 months agoMITView on GitHub
GitHub repo: <https://github.com/szaffarano/org-mcp-server/> MCP server for org-mode knowledge management in Rust. Provides search, content access, agenda views, and note linking for org-mode files through the Model Context Protocol. Rust 2024 edition, multi-crate workspace with async-first design (tokio). TOML config at ~/.config/org-mcp/config.toml. Layered: defaults < config file < env vars (ORG_ prefix, __ separator) < CLI flags. See org-core/src/config.rs for OrgConfig and LoggingConfig. Notable capture-related field: org_auto_created_property: bool (default true) controls whether capture_append prepends a :CREATED: property. OrgMode::capture_append (in org-core/src/org_mode/capture.rs) is…
In this repository5 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- org-agendaSkill
- org-captureSkill
- org-searchSkill
- org-update-todoSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 92
Test fixtures for new org-mode features go in test-utils/fixtures/
- Very specific: line 95
Always run cargo clippy and cargo fmt before committing
- Distinctive: line 100
NEVER create files unless absolutely necessary
- Distinctive: line 103
Use the Context7 mcp server to get docs and code examples
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
GitHub repo: https://github.com/szaffarano/org-mcp-server/
MCP server for org-mode knowledge management in Rust. Provides search, content access, agenda views, and note linking for org-mode files through the Model Context Protocol.
Development Commands
cargo build # Build all crates (~47s, never cancel)
cargo test # Run all tests
cargo test <test_name> # Run specific test
cargo test -p <crate_name> # Test specific crate (org-core, org-mcp-server, org-cli)
cargo test --test integration_tests # Run MCP server integration tests
cargo clippy --all-targets --all-features -- -D warnings # Lint
cargo fmt --all # Format code
cargo run --bin org-cli -- --help # Run CLI tool
cargo run --bin org-mcp-server # Run MCP server (needs valid org directory)
cargo run --example <name> # Run playground examples (in org-core/examples/)Just Commands (available in nix devShell)
just dev # Full workflow: format, lint, test, coverage
just check # Quality gate: fmt-check, lint, test, coverage
just test # Run all tests
just lint # Clippy with -D warnings
just fmt # Format code
just coverage-html # HTML coverage in coverage/html/Architecture
Rust 2024 edition, multi-crate workspace with async-first design (tokio).
Crate Dependency Flow
org-core <-- org-mcp-server
org-core <-- org-cli
test-utils <-- org-core (dev), org-mcp-server (dev), org-cli (dev)org-core— All business logic: org-mode parsing (orgize), file discovery (ignorecrate'sWalk), fuzzy search (nucleo-matcher), agenda/task querying, configuration loading (configcrate with TOML/YAML/JSON + env vars). Central type isOrgModestruct (org-core/src/org_mode/types.rs) which holds anOrgConfigand provides all operations. Custom error typeOrgModeErrorinorg-core/src/error.rs.org-mcp-server— MCP protocol layer usingrmcp.OrgModeRouter(src/core.rs) wrapsArc<Mutex<OrgMode>>and aToolRouter. Resources (src/resources/mod.rs) implementServerHandlerwith URI-based routing (org://, org-outline://, org-heading://, org-id://, org-agenda://). Tools (src/tools/) expose org-file-list, org-search, org-agenda, org-capture. Server runs over stdio transport.org-cli— CLI usingclapwith subcommands: config, list, read, outline, heading, element-by-id, search, agenda, capture. Each command insrc/commands/. Delegates toOrgModefrom org-core. TheCommands::Captureenum variant is boxed (Box<CaptureCommand>) to keep the enum size small.test-utils— Shared test infrastructure. Fixtures intest-utils/fixtures/(20 .org files). Key helpers:setup_test_org_files()copies fixtures to temp dir,setup_test_org_files_with_dates()replaces date placeholders (@TODAY@,@TODAY+N@) for time-sensitive agenda tests.
Key Dependencies
orgize(custom fork) — org-mode parsing, traversal viafrom_fn/from_fn_with_ctxhandlersrmcp— MCP protocol (tools, resources, stdio transport)nucleo-matcher— fuzzy text searchignore— gitignore-aware file walkingconfig— layered configuration (file + env + defaults)
Configuration
TOML config at ~/.config/org-mcp/config.toml. Layered: defaults < config file < env vars (ORG_ prefix, __ separator) < CLI flags. See org-core/src/config.rs for OrgConfig and LoggingConfig. Notable capture-related field: org_auto_created_property: bool (default true) controls whether capture_append prepends a :CREATED: property.
Capture path internals
OrgMode::capture_append (in org-core/src/org_mode/capture.rs) is the central write path. Highlights:
- Per-target
<file>.locksibling file for cross-process serialization, with stat-after-lock verification so the lockfile can be safely unlinked on release. - Atomic write via
tempfile.persist-style temp file +fsync+renameso a crash mid-write cannot truncate user data. - Validation order: title → level → todo_state → priority → tags → planning timestamps → datetree → properties → auto-CREATED prepend.
parse_iso_timestampacceptsYYYY-MM-DD [HH:MM] [repeater] [warning].format_org_timestamprenders the canonical<...>/[...]form.- Datetree expansion prepends Year / Year-Month-Name / Year-Month-Day-Day segments to the resolved heading path before
find_heading_pathruns; the existing missing-segment creation logic handles first-of-day creation and idempotent reuse.
Code Style
cargo fmtbefore every commit- String interpolation:
"string {var}"not"string {}", var - Imports: std before external crates
- Tests:
assert_eq!overassert!,#[cfg(test)]modules for unit tests - Error handling:
Result<T, OrgModeError>, never panic - Workspace deps defined in root
Cargo.toml, crates reference withworkspace = true
Development Workflow
- New functionality goes into
org-core, then gets exposed viaorg-mcp-serverand/ororg-cli - Multi-crate dep changes go in root
Cargo.toml[workspace.dependencies] - Test fixtures for new org-mode features go in
test-utils/fixtures/ - Integration tests for MCP server use the
create_mcp_service!macro that spawns the server binary as a child process - Config tests using env vars must use
#[serial]fromserial_testcrate - Always run
cargo clippyandcargo fmtbefore committing
Behavioral Guidelines
- Concise responses, be direct
- NEVER create files unless absolutely necessary
- Commits: always sign with
-S - Documentation: only create when explicitly requested
- Use the Context7 mcp server to get docs and code examples
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

