org-mcp
Copilot instructions4 starsChanged 15 months agoMITView on GitHub
org-mcp is a Rust Model Context Protocol (MCP) server for org-mode knowledge management. It provides search, content access, and note linking capabilities for org-mode files through the MCP protocol. ALWAYS reference these instructions first and fallback to the CLAUDE.md file, search, or bash commands only when you encounter unexpected information that does not match the info here. - NEVER CANCEL builds or tests - they may take up to 90 seconds to complete - Build the workspace: cargo build --…
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
35 rules. About 0 are common, 11 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 20
Run tests: cargo test -- takes ~2 seconds, 36 tests.
- Very specific: line 24
Check formatting: cargo fmt --check -- takes \<1 second.
- Very specific: line 28
Run CLI tool: cargo run --bin org-cli -- --help
- Very specific: line 29
Run MCP server: cargo run --bin org-mcp (needs valid org directory)
- Very specific: line 30
Run examples: cargo run --example <name> (examples in org-core/examples/)
- Very specific: line 31
Test specific crate: cargo test -p <crate-name>
- Very specific: line 38
Build validation: Run cargo build and wait for completion (90+ seconds)
- Very specific: line 40
Test validation: Run cargo test and verify all 36 tests pass
- Distinctive: line 42
CLI validation: Test core CLI functionality:
- Very specific: line 51
Linting validation: Run cargo clippy and cargo fmt --check
- Distinctive: line 55
ALWAYS: test the CLI with actual org files after making changes
- Distinctive: line 56
ALWAYS: verify that the core functionality works with test fixtures
- Very specific: line 57
Use org-core/tests/fixtures/ for testing - contains 8 org files with various structures
- Very specific: line 59
Test files include: sample.org, with_ids.org, nested.org, etc.
- Distinctive: line 97
Use custom error types with proper chaining
- Very specific: line 98
Prefer explicit Result<T, E> over panics
- Very specific: line 99
Check org-core/src/error.rs for error definitions
- Distinctive: line 105
Always: start by running the full validation suite
- Very specific: line 107
Build immediately: after changes: cargo build (wait 90+ seconds)
- Very specific: line 108
Test immediately: after changes: cargo test
- Distinctive: line 109
Always: run CLI validation scenarios
- Very specific: line 110
Always: run cargo clippy and cargo fmt before committing
- Very specific: line 114
Use cargo fmt before all commits
- Very specific: line 115
Use "string {var}" over "string {}", var
- Very specific: line 117
Add #[cfg(test)] modules for tests
- Very specific: line 118
Use assert_eq! over assert!
- Distinctive: line 124
CRITICAL: Always test with real org files using CLI commands
- Distinctive: line 125
Test files contain various org-mode features (headings, IDs, properties)
- Very specific: line 186
Use element-by-id command to find org elements by ID property
- Distinctive: line 192
All file paths are validated at construction, not runtime
- Very specific: line 193
Use shellexpand for path expansion
- Very specific: line 194
Default org directory is ~/org/ but can be overridden
- Very specific: line 204
Use nix develop for development shell with all dependencies
- Distinctive: line 212
ALWAYS: run the complete test suite before committing
- Distinctive: line 213
ALWAYS: use appropriate timeouts (90+ seconds for builds, 30+ seconds for tests)
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
org-mcp
org-mcp is a Rust Model Context Protocol (MCP) server for org-mode knowledge management. It provides search, content access, and note linking capabilities for org-mode files through the MCP protocol.
ALWAYS reference these instructions first and fallback to the CLAUDE.md file, search, or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Bootstrap and Build
- NEVER CANCEL builds or tests - they may take up to 90 seconds to complete
- Build the workspace:
cargo build-- takes ~47 seconds. NEVER CANCEL. Set timeout to 90+ seconds. - Release build:
cargo build --release-- takes ~47 seconds. NEVER CANCEL. Set timeout to 90+ seconds. - Run tests:
cargo test-- takes ~2 seconds, 36 tests. Safe timeout 30+ seconds. - Lint code:
cargo clippy-- takes ~11 seconds. Safe timeout 30+ seconds. - Format code:
cargo fmt-- takes <1 second. Always run before commits. - Check formatting:
cargo fmt --check-- takes <1 second.
Development Commands
- Run CLI tool:
cargo run --bin org-cli -- --help - Run MCP server:
cargo run --bin org-mcp(needs valid org directory) - Run examples:
cargo run --example <name>(examples inorg-core/examples/) - Test specific crate:
cargo test -p <crate-name> - Build specific crate:
cargo build -p <crate-name>
Validation
CRITICAL: Always Test These Scenarios After Changes
- Build validation: Run
cargo buildand wait for completion (90+ seconds) - Test validation: Run
cargo testand verify all 36 tests pass CLI validation: Test core CLI functionality:
cargo run --bin org-cli -- list --dir org-core/tests/fixtures cargo run --bin org-cli -- read --dir org-core/tests/fixtures sample.org cargo run --bin org-cli -- outline --dir org-core/tests/fixtures sample.org cargo run --bin org-cli -- element-by-id --dir org-core/tests/fixtures simple-123- Linting validation: Run
cargo clippyandcargo fmt --check
Manual Testing Requirements
- ALWAYS test the CLI with actual org files after making changes
- ALWAYS verify that the core functionality works with test fixtures
- Use
org-core/tests/fixtures/for testing - contains 8 org files with various structures - Test files include:
sample.org,with_ids.org,nested.org, etc.
Project Structure
Multi-Crate Workspace
- org-core — Business logic and org-mode parsing (
org-core/src/) - mcp-server — MCP protocol implementation (
mcp-server/src/) - org-cli — CLI interface for testing (
org-cli/src/)
Key Directories
org-core/examples/— Playground examples for experimentationorg-core/tests/fixtures/— Test org files for validationorg-core/src/— Core business logic (lib.rs, org_mode.rs, error.rs)mcp-server/src/— MCP server (main.rs, core.rs, resources/, tools/)org-cli/src/— CLI tool implementation
Configuration Files
Cargo.toml— Workspace configurationflake.nix— Nix development environmentCLAUDE.md— Development guidelinesREADME.md— Project documentation
Architecture and Dependencies
Tech Stack
- Rust 2024 edition with async-first design using
tokio - orgize for org-mode parsing
- rmcp for MCP protocol implementation
- clap for CLI interface
- walkdir for file traversal
- serde/serde_json for serialization
Error Handling
- Use custom error types with proper chaining
- Prefer explicit
Result<T, E>over panics - Check
org-core/src/error.rsfor error definitions
Development Workflow
Making Changes
- Always start by running the full validation suite
- Make focused, minimal changes
- Build immediately after changes:
cargo build(wait 90+ seconds) - Test immediately after changes:
cargo test - Always run CLI validation scenarios
- Always run
cargo clippyandcargo fmtbefore committing
Code Style
- Use
cargo fmtbefore all commits - Use
"string {var}"over"string {}", var - Standard library imports before external crates
- Add
#[cfg(test)]modules for tests - Use
assert_eq!overassert!in tests
Testing Strategy
- Unit tests in each crate with
#[cfg(test)]modules - Integration tests use fixtures in
org-core/tests/fixtures/ - CRITICAL: Always test with real org files using CLI commands
- Test files contain various org-mode features (headings, IDs, properties)
Common Tasks
Repository Root Structure
.
├── Cargo.toml # Workspace config
├── README.org # Project documentation
├── CLAUDE.md # Development guidelines
├── flake.nix # Nix development environment
├── org-core/ # Core business logic
│ ├── src/
│ ├── examples/ # Experimentation examples
│ └── tests/fixtures/ # Test org files
├── mcp-server/ # MCP protocol server
│ └── src/
└── org-cli/ # CLI tool
└── src/Frequently Used Commands Output
CLI Help:
$ cargo run --bin org-cli -- --help
A CLI tool for org-mode functionality
Usage: org-cli <COMMAND>
Commands:
list List all .org files in a directory
init Initialize or validate an org directory
read Read the contents of an org file
outline Get the outline (headings) of an org file
heading Extract content from a specific heading
element-by-id Extract content from an element by ID
help Print this message or help of subcommandTest Fixtures List:
$ cargo run --bin org-cli -- list --dir org-core/tests/fixtures
Found 8 .org files in org-core/tests/fixtures:
edge_cases.org
doc_with_id.org
nested.org
sample.org
multi_file_a.org
with_ids.org
multi_file_b.org
simple.orgKey Implementation Details
ID-Based Element Lookup
- Use
element-by-idcommand to find org elements by ID property - Test with:
cargo run --bin org-cli -- element-by-id --dir org-core/tests/fixtures simple-123 - IDs are defined in
:PROPERTIES:blocks in org files
File Operations
- All file paths are validated at construction, not runtime
- Use
shellexpandfor path expansion - Default org directory is
~/org/but can be overridden
MCP Server Limitations
- Current MCP server implementation needs directory configuration improvements
- Server provides resources:
org://,org://file,org-outline://, `org-he - Tools available:
org-file-list
Nix Development Environment
- Use
nix developfor development shell with all dependencies - Flake provides rust toolchain, cargo tools, and formatters
- Pre-commit hooks available for formatting and linting
CRITICAL REMINDERS
- NEVER CANCEL build commands - they may take 90+ seconds
- ALWAYS validate with CLI scenarios after changes
- ALWAYS run the complete test suite before committing
- ALWAYS use appropriate timeouts (90+ seconds for builds, 30+ seconds for tests)
- Build times are normal - do not attempt to interrupt or optimize prematurely
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.

