The primary MCP tool server for coding workflows. Provides file I/O, shell execution, LSP code intelligence, and web fetch/search -- all exposed as MCP tools that an agent can invoke.
# Construction
Use the builder-style methods to configure the server:
```rust,ignore
use mcp_servers::CodingMcp;
// Default: local filesystem tools rooted at the project, no LSP
let server = CodingMcp::new("/my/project");
// With LSP code intelligence for that root and explicit read-rule directories
let server = CodingMcp::new("/my/project")
.with_rules_dirs(&["/my/project/.aether/skills".into(), "/my/project/.claude/rules".into()])
.with_lsp()
.with_permission_mode(mcp_servers::PermissionMode::Auto);
```
# Tools provided
**File operations:**
- `read_file` -- Read file contents with optional offset/limit
- `write_file` -- Write content to a file (creates parent dirs)
- `edit_file` -- String replacement in an existing file
**Shell:**
- `bash` -- Execute shell commands (with background process support)
**Web:**
- `web_fetch` -- Fetch a URL and extract text content
- `web_search` -- Web search via Brave Search API
**LSP** (requires [`with_lsp`](CodingMcp::with_lsp)):
- `lsp_symbol` -- Go to definition, find references, hover for types and docs
- `lsp_check_errors` -- Get diagnostics for a file or workspace
- `lsp_rename` -- Rename a symbol across the project
# Safety
The server enforces several safety checks:
- **Read-before-edit** -- `write_file` and `edit_file` require the file to have been read first in the same session, preventing blind overwrites.
- **Dangerous command detection** -- Bash commands containing destructive patterns (`rm`, `git push --force`, redirect operators, etc.) are flagged.
- **Permission modes** -- [`PermissionMode`] controls whether flagged operations require user approval via MCP elicitation.
# See also
- [`PermissionMode`] -- User approval settings
- [`LspRegistry`](crate::lsp::LspRegistry) -- LSP daemon connection manager
- [`CodingError`](crate::coding::error::CodingError) -- Error types for tool operations