← Back to Index | ← Installation | Next: Quick Start →
- Getting Your HacknPlan API Key
- Claude Code Configuration
- Environment Variables
- Project-Scoped Configuration
- Security Best Practices
- Verification
- Log into HacknPlan
- Click your profile icon (top-right)
- Select Settings
- Navigate to API Beta tab
- Click Create button
- Enter a descriptive name (e.g., "Claude MCP Server")
- Copy the generated API key immediately
- Important: Store securely - you cannot view it again!
claude mcp add hacknplan \
-s user \
-e HACKNPLAN_API_KEY=your-api-key \
-e HACKNPLAN_DELETION_CACHE_SIZE=1000 \
-- node /path/to/hacknplan-mcp/dist/index.jsEdit ~/.claude.json:
{
"mcpServers": {
"hacknplan": {
"command": "node",
"args": ["/path/to/hacknplan-mcp/dist/index.js"],
"env": {
"HACKNPLAN_API_KEY": "your-api-key-here",
"HACKNPLAN_DEFAULT_PROJECT": "230954",
"HACKNPLAN_DELETION_CACHE_SIZE": "1000"
}
}
}
}Path Notes:
- Windows:
C:\path\to\hacknplan-mcp\dist\index.js - macOS/Linux:
/absolute/path/to/hacknplan-mcp/dist/index.js - Use absolute paths, not relative
Required: Yes Type: String Description: Your HacknPlan API authentication key
export HACKNPLAN_API_KEY="sk_hacknplan_abc123..."Security: Must be set as environment variable. CLI arguments (e.g., --api-key=...) are rejected to prevent exposure in process listings.
Required: No Type: Number (project ID) Description: Default project ID when not specified in tool calls
export HACKNPLAN_DEFAULT_PROJECT="230954"When to use: Working primarily with one project to avoid passing projectId repeatedly.
Required: No
Type: Boolean (true or false)
Default: false
Description: Enable slim mode (26 core tools vs 89 full tools)
export HACKNPLAN_SLIM_MODE="true"Impact: ~71% reduction in tool loading context. See Slim Mode Guide.
Required: No
Type: slim | full
Default: full
Description: Response detail level
export HACKNPLAN_OUTPUT_VERBOSITY="slim"slim: Minimal fields + index arrays for quick lookupsfull: Complete objects with all fields
Required: No Type: Number Default: 1000 Description: LRU cache capacity for deleted item recovery
export HACKNPLAN_DELETION_CACHE_SIZE="2000"Required: No
Type: Boolean (true or false)
Default: false
Description: Enforce 2-step confirmation for ALL deletions
export HACKNPLAN_REQUIRE_DELETE_CONFIRMATION="true"Modes:
false(default): Single-step deletion with auto-recoverytrue: All deletions require explicit confirmation viaconfirm_deletion
Override defaults for specific directories using .mcp.json:
{
"HACKNPLAN_DEFAULT_PROJECT": 230809
}Place in your working directory to set project-specific defaults.
When determining which project to use:
- Explicit parameter:
projectIdin tool call - Local config:
.mcp.jsonin current working directory - Environment variable:
HACKNPLAN_DEFAULT_PROJECT - Error: Display available projects list
- Multi-project workflows: Different projects per directory
- Team collaboration: Share
.mcp.jsonin repositories - Context switching: Automatic project selection based on location
✅ Do:
- Store in environment variables
- Use secret management tools (Vault, AWS Secrets Manager)
- Set restrictive file permissions on config files (
chmod 600 ~/.claude.json)
❌ Don't:
- Commit API keys to version control
- Pass as CLI arguments
- Share API keys in screenshots or logs
- Store in plaintext files
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc
export HACKNPLAN_API_KEY="your-key"
# Windows - Use User Environment Variables (not System)
# Settings > System > About > Advanced system settings > Environment Variables- Create new API key in HacknPlan
- Update environment variable
- Restart MCP server
- Verify with
claude mcp list - Delete old key in HacknPlan
# List configured servers
claude mcp list
# Should show:
# hacknplan: node /path/to/dist/index.js - Connected# From Claude Code
# Call any simple tool like list_projects to verifyServer not listed:
# Verify configuration file exists
cat ~/.claude.json
# Check for JSON syntax errorsConnection failed:
# Verify API key is set
echo $HACKNPLAN_API_KEY
# Rebuild server
cd /path/to/hacknplan-mcp
npm run buildPermission denied:
# Check file permissions
ls -la ~/.claude.json
chmod 600 ~/.claude.jsonWith configuration complete:
- Quick Start Guide → - Make your first API calls
- Slim Mode Guide - Optimize context usage
- Deletion Safety Guide - Configure deletion protection
See Also:
- Installation Guide - Setting up the server
- Tool Search Guide - Claude API optimization
- Development Guide - Contributing to the project