# talaan-mcp An MCP server for Talaan, so AI assistants (Claude Code, Claude Desktop and other MCP clients) can search, read and, when you allow it, change the directory. **Docs:** [MCP: Talaan for AI assistants](https://talaan-dev.github.io/docs/guides/mcp.html). Part of [Talaan](https://github.com/talaan-dev/talaan), a lightweight LDAPv3 + SCIM directory server with a full change history. It's a module of the server (off by default: `[modules] mcp = true`), speaking MCP's Streamable HTTP transport at `POST /mcp` on the HTTP listener. | Tool | Does | Needs | |---|---|---| | `search_entries` | LDAP filter search, optionally `as_of` a past change or time | read access | | `get_entry` | one entry with server-kept attributes, optionally `as_of` | read access | | `entry_history` | every change to an entry, newest first | own entry, or admin | | `recent_changes` | latest changes to the whole directory (secrets removed) | admin | | `whoami` | the identity the tools run as | - | | `add_entry`, `modify_entry`, `delete_entry`, `unlock_account` | change the directory | `[mcp] allow_writes = true` and write access | - **Same rules as LDAP:** the client sends `Authorization: Bearer ` (admin) or `Basic` (a user). Access rules, lockout and rate limits apply to every call, and every change is recorded with that identity as actor. - **Read-only by default.** Write tools aren't even listed until `allow_writes` is set, and they carry MCP's destructive and idempotent hints, so clients can ask before running them. - **Passwords are never returned.** Results are capped at 50 by default (500 at most). - **Browser safety:** a request with an `Origin` header must come from the server's own host (MCP's DNS-rebinding rule). There are no sessions; `GET /mcp` answers 405. - **Prompt injection:** directory values are written by people. The server tells the assistant to treat them as data, but keep `allow_writes` off unless the assistant's identity is limited to what it should change. ## Connect ```sh claude mcp add --transport http talaan https://talaan.example.org/mcp --header "Authorization: Bearer $TALAAN_API_TOKEN" ``` Clients that only speak stdio: `npx mcp-remote https://talaan.example.org/mcp --header "Authorization: Bearer ..."`. Try it locally: `cargo run --example demo` serves a sample directory at http://127.0.0.1:8098/mcp (token `demo-token`). ```toml [dependencies] talaan-mcp = "0.4.1" ``` License: Apache-2.0