Expand description
Profile system for reusable MCP prompts and personas.
Profiles are named personas that combine a system prompt, scoped tools, and optional dynamic context injection. They enable “assume a role” workflows in Cursor, Claude Desktop, and other MCP clients.
§Architecture
┌──────────────────────────────────────────┐
│ ProfileRegistry │
│ ┌─────────┐ ┌─────────┐ ┌────────────┐ │
│ │ TOML │ │ Lua │ │ Custom │ │
│ │ Inline │ │ Script │ │ (Rust) │ │
│ └─────────┘ └─────────┘ └────────────┘ │
└──────────────┬───────────────────────────┘
▼
GET /profiles/list · POST /profiles/{name}/prompt§Profile Sources
| Source | Config Key | Struct |
|---|---|---|
| Inline TOML | [profiles.inline.<name>] | TomlProfile |
| Lua script | [profiles.script.<name>] | LuaProfileAdapter (in crate::profile_script) |
| Custom Rust | registry.register(...) | User-defined Profile impl |
§Usage
use context_harness::profiles::{ProfileRegistry, TomlProfile};
let mut profiles = ProfileRegistry::new();
profiles.register(Box::new(TomlProfile::new(
"reviewer".to_string(),
"Reviews code against conventions".to_string(),
vec!["search".to_string(), "get".to_string()],
"You are a senior code reviewer.".to_string(),
)));See the profiles documentation for the full specification.
Structs§
- Profile
Argument - An argument that an profile accepts.
- Profile
Info - Serializable profile info for the
/profiles/listendpoint. - Profile
Prompt - A resolved profile prompt ready for the LLM.
- Profile
Registry - Registry for profiles (TOML, Lua, and custom Rust).
- Prompt
Message - A message to inject into the conversation.
- Toml
Profile - An profile defined inline in TOML configuration.
Traits§
- Profile
- A reusable persona that provides a system prompt and tool scoping.