self-claude-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@self-claude-mcphot restart my Claude session"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
self-claude-mcp
Requires Claude Code | SIGN UP HERE
MCP server for Claude Code self-management commands (hot restart, compaction).
Installation
pip install self-claude-mcpAdd to your Claude MCP config:
{
"mcpServers": {
"self-claude": {
"command": "self-claude-mcp",
"env": {
"AUTOPOIESIS": "1"
}
}
}
}Note:
AUTOPOIESIS=1is optional. If set, restart messages will remind Claude to enable autopoiesis-mcp (makes Claude loop on purpose). Remove theenvblock if you don't use it.
Related MCP server: claude-sessions-mcp
Setup
After installing the MCP, Claude needs to install bash scripts for the commands to work.
Ask Claude to run:
Use self_claude with setup_only=True and install the scriptsOr manually: call self_claude(cmd="", setup_only=True) to get the installation instructions.
Requirements
tmux: Scripts use tmux for session management
Claude Code: Must be running inside a tmux session named "claude"
Starting Claude in tmux
Use claude-debug (installed by setup) or manually:
tmux -u new-session -d -s claude
tmux send-keys -t claude 'claude --debug' Enter
tmux -u attach -t claudeUsage
Once set up, Claude can use these commands:
Command | Description |
| Hot restart with auto-resume |
| Trigger context compaction |
| Get installation instructions |
Hot Restart
Use when MCP configs change and you need to reload without losing conversation:
Claude calls
self_claude("self_restart")→ returnsbash self_restartClaude runs
bash self_restartHandler sends
/exit, waits for death, relaunches, sends/resume, selects session 1
Compaction
Use when context is running low:
Claude calls
self_claude("self_compact")→ returnsbash self_compactClaude runs
bash self_compactSends
/compactto the tmux session
Troubleshooting
"No tmux session 'claude'"
Make sure Claude Code is running inside a tmux session named "claude":
tmux -u new-session -s claude
claude --debug"Handler not found"
Run the setup instructions again:
self_claude(cmd="", setup_only=True)Then install the scripts to /usr/local/bin/.
Restart hangs
Check the handler log:
cat /tmp/claude_restart_handler.logCommon issues:
pgrep -x "claude"matches wrong process → verify withpgrep -x "claude"tmux session died → restart with
claude-debug
Docker / Container
If running in a container, make sure:
tmux is installed:
apt install tmuxScripts are in PATH:
/usr/local/bin/or~/.local/bin/Container user can write to
/tmp/
Scripts Installed
Script | Location | Purpose |
|
| Start Claude in tmux background |
|
| Orchestrator (spawns handler) |
|
| Detached handler (does actual restart) |
|
| Trigger compaction |
|
| Manage Claude Code rule files |
rules command
Manage Claude Code rule files from the command line:
# Add a rule
rules global my-rules "Always use TypeScript"
rules project api-rules "Use REST conventions"
# List rules
rules show global
rules show project
# Delete a rule
rules delete global my-rulesRules are stored in ~/.claude/rules/ (global) or ./.claude/rules/ (project).
Environment Variables
Variable | Description |
| Enable autopoiesis warning in restart message. Requires autopoiesis-mcp. |
Set in your shell profile or export before running Claude.
Security Note
⚠️ Warning: You should disallow this MCP on subagents. Subagents running these commands can cause strange interactions.
License
MIT
Available Tools
1 toolself_claudeC
Execute self-Claude command.
| Name | Required | Description | Default |
|---|---|---|---|
| cmd | Yes | self_restart | self_compact | |
| help | No | Include help text | |
| setup_only | No | Return setup instructions instead of executing |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of disclosing behavioral traits. It only says 'execute' without mentioning that commands like restart or compact may have side effects, require confirmation, or alter state. The behavior is almost entirely opaque.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence, which is concise and free of fluff. However, it lacks structuring of information and is under-specified for the tool's functionality, making it neither well-structured nor sufficiently informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema and three parameters, the description is extremely thin. It fails to explain the purpose of commands like restart and compact, the effect of setup_only, or any context for use. The tool's complexity is not addressed, making the description inadequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the parameters. The description adds no additional meaning beyond the schema, but per the baseline rule for high coverage, a score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Execute self-Claude command.' provides a verb and a vague resource, but it does not specify what commands are available or what they do. It borders on a tautology, as 'self-Claude command' essentially restates the tool name without adding clarity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool, which command to choose, or how it relates to alternatives. The schema lists 'self_restart' and 'self_compact', but the description does not explain when each should be used or any prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.2.0- First observed
self_claude
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between tools. The tool's purpose is isolated.
With a single tool, naming consistency is trivially perfect. The name 'self_claude' follows a clean snake_case pattern.
A single tool makes for a very thin server, but it could be appropriate if the server is meant to handle a single command. Still, it feels borderline for most practical purposes.
The sole tool's description is extremely vague ('Execute self-Claude command'), giving no indication of supported subcommands or operations. Significant gaps likely exist for any meaningful workflow, and agents would struggle to use it effectively.
Maintenance
Related MCP Connectors
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server that builds itself by creating new tools as needed based on user requests (Requires restart of Claude Desktop to use newly created tools).425-
- AlicenseBqualityDmaintenanceMCP server for managing Claude Code conversation sessions1260MIT
- AlicenseNot gradedqualityCmaintenanceLocal MCP server for Claude Code providing persistent memory, task planning, and agent coordination with full transparency and no network calls.2MIT
- FlicenseNot gradedqualityFmaintenanceAn MCP server for coordinating multiple Claude Code sessions across related projects.-