doozMen/prompteneer
If you are the rightful owner of prompteneer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Prompteneer is a privacy-focused agent orchestration server utilizing Apple's Foundation Models framework for intelligent agent discovery, request analysis, and routing.
Prompteneer - Agent Orchestration MCP Server
Privacy-focused agent orchestration server using Apple's Foundation Models framework for intelligent agent discovery, request analysis, and routing.
Overview
Prompteneer provides secure, on-device agent orchestration capabilities through the Model Context Protocol. Using Apple's Foundation Models with keyword-based fallback, it analyzes user requests and intelligently matches them with specialized Claude Code agents. All processing happens locally - no data is sent to external servers.
Features
- Privacy-First: 100% on-device processing with Apple Intelligence
- Agent Orchestration: Discover, match, and route to 40+ specialized agents
- Intelligent Prompt Enhancement: Automatically rebuild prompts with contextual agent injection
- Foundation Models: Native Apple Intelligence integration (macOS 26+)
- Hybrid Fallback: Keyword-based analysis for macOS 15+ compatibility
- Request Analysis: Intent detection, technology identification, complexity scoring
- Text Analysis: Query, summarize, sentiment analysis (legacy tools)
- PII Detection: Identify personally identifiable information before sharing
- MCP Integration: Seamless integration with Claude Code
Installation
Prerequisites
- macOS 15.0+
- Swift 6.0+
- Xcode Command Line Tools
Quick Install
cd prompteneer
./install.sh
The install script will:
- Build in release mode
- Install to
~/.swiftpm/bin - Automatically configure Claude Code (if CLI available)
- Create config backup for safety
Manual Build and Install
# Build in release mode
swift build -c release
# Install to ~/.swiftpm/bin
rm -f ~/.swiftpm/bin/prompteneer
swift package experimental-install
Verify Installation
prompteneer --version
# Should output: prompteneer 0.0.1
which prompteneer
# Should output: /Users/[username]/.swiftpm/bin/prompteneer
Configuration
Option 1: Automatic (Recommended)
The install script automatically configures Claude Code. If you need to reconfigure:
claude mcp add -s user prompteneer prompteneer \
-e PATH="$HOME/.swiftpm/bin:/usr/local/bin:/usr/bin:/bin"
Option 2: Manual Configuration
Add to ~/.claude.json:
{
"mcpServers": {
"prompteneer": {
"type": "stdio",
"command": "prompteneer",
"args": ["--log-level", "info"],
"env": {
"PATH": "$HOME/.swiftpm/bin:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Restart Claude Code after configuration:
claude-code restart
Available Tools
Prompteneer provides 9 powerful tools via MCP protocol:
Agent Orchestration Tools (Primary Focus):
analyze_request- Analyze user requests (intent, technologies, complexity)discover_agents- List all available Claude Code agentsmatch_agents- Match agents to requests with relevance scoringexplain_routing- Explain why specific agents were recommendedoptimize_prompt- Flagship: Intelligently rebuild prompts with agent injection
Legacy LLM Tools (Foundational):
query- Execute LLM queries with local modelssummarize- Summarize text contentanalyze_sentiment- Sentiment analysisdetect_pii- Detect personally identifiable information
1. query - Execute LLM Query
Execute a query using local AI models.
Parameters:
prompt(string, required): User query or promptmodel(string, optional): Model to use"apple-intelligence"(default)"phi-3-mini""tinyllama"
max_tokens(int, optional): Maximum tokens (default: 1000)temperature(float, optional): Sampling temperature 0.0-1.0 (default: 0.7)
Example:
{
"name": "query",
"arguments": {
"prompt": "Explain quantum computing in simple terms",
"model": "apple-intelligence",
"max_tokens": 500
}
}
Returns:
Response: [AI-generated response]
Model: Apple Intelligence
Tokens: 125
Inference Time: 342ms
Privacy: On-device (✓)
2. summarize - Summarize Text
Summarize long text content locally.
Parameters:
text(string, required): Content to summarizemax_length(int, optional): Maximum word count for summary
Example:
{
"name": "summarize",
"arguments": {
"text": "Long article text here...",
"max_length": 100
}
}
Returns:
Summary: [Condensed summary]
Original Length: 1523 chars
Summary Length: 456 chars
Compression Ratio: 0.30
3. analyze_sentiment - Sentiment Analysis
Analyze emotional tone of text locally.
Parameters:
text(string, required): Content to analyze
Example:
{
"name": "analyze_sentiment",
"arguments": {
"text": "I absolutely loved the new feature! It works great."
}
}
Returns:
Sentiment: Positive 😊
Confidence: 87%
Analysis performed locally on-device.
4. detect_pii - Detect Personal Information
Scan text for personally identifiable information.
Parameters:
text(string, required): Content to scan
Example:
{
"name": "detect_pii",
"arguments": {
"text": "Contact John Smith at john@example.com"
}
}
Returns:
⚠️ PII Detected: YES
Detected Types: email, name
Warning: This text contains personally identifiable information.
5. analyze_request - Analyze User Request
Analyze user requests to understand intent, extract keywords, identify technologies, and estimate complexity using Foundation Models or keyword-based analysis.
Parameters:
request(string, required): User request or query to analyze
Example:
{
"name": "analyze_request",
"arguments": {
"request": "I need to build a SwiftUI app with Core Data and Firebase"
}
}
Returns (Foundation Models):
Request Analysis (Foundation Models):
Intent: Development
Keywords: SwiftUI, Core Data, Firebase
Technologies: Swift, Core Data, Firebase
Complexity: 0.7
Analysis performed using Apple Intelligence.
Returns (Keyword Fallback):
Request Analysis (Keyword-Based):
Intent: development
Keywords: build, swiftui, app, core, data, firebase
Technologies: swift, database, firebase
Complexity Score: 0.68
Confidence: 0.60
Analysis performed using keyword-based heuristics.
6. discover_agents - Discover Available Agents
List all available Claude Code agents from ~/.claude/agents/ directory with their capabilities, tools, and models.
Parameters: None
Example:
{
"name": "discover_agents",
"arguments": {}
}
Returns:
Discovered 40 agent(s):
- swift-architect
ID: swift-architect.md
Description: Specialized in Swift 6.0 architecture patterns, async/await, actors
Tools: Read, Edit, Glob, Grep, Bash, MultiEdit
Model: sonnet
- swiftui-specialist
ID: swiftui-specialist.md
Description: Expert in SwiftUI app development and state management
Tools: Read, Edit, Glob, Grep, Bash, MultiEdit
Model: sonnet
[... 38 more agents ...]
7. match_agents - Match Agents to Request
Match available agents to a user request based on relevance. Returns top N agents with relevance scores and reasoning.
Parameters:
request(string, required): User request to match against agentstop_n(int, optional): Number of top agents to return (default: 3)
Example:
{
"name": "match_agents",
"arguments": {
"request": "Help me migrate my iOS app to Swift 6 concurrency with actors",
"top_n": 3
}
}
Returns:
Top 3 agent(s) for request:
1. swift-architect (Score: 46%)
Description: Specialized in Swift 6.0 architecture patterns, async/await, actors
Tools: Read, Edit, Glob, Grep, Bash, MultiEdit
Reasoning: Keyword overlap: 46% - Matched terms in agent description and tools
2. swift-modernizer (Score: 38%)
Description: Focused on migrating legacy code to Swift 6.0
Tools: Read, Edit, Glob, Grep, Bash, MultiEdit, WebSearch
Reasoning: Keyword overlap: 38% - Matched terms in agent description and tools
3. swift-developer (Score: 28%)
Description: Expert Swift developer for implementing features
Tools: Read, Edit, Glob, Grep, Bash, MultiEdit
Reasoning: Keyword overlap: 28% - Matched terms in agent description and tools
Request Analysis:
- Intent: architecture
- Technologies: swift, ios, actor, concurrency
- Complexity: 0.72
8. explain_routing - Explain Agent Recommendations
Provide detailed explanations for why specific agents were recommended for a request, including matched criteria and reasoning.
Parameters:
request(string, required): User request to explain routing fortop_n(int, optional): Number of top agents to explain (default: 3)
Example:
{
"name": "explain_routing",
"arguments": {
"request": "Help me write comprehensive tests for my Swift package",
"top_n": 2
}
}
Returns:
Routing Explanation:
Request Analysis:
- Intent: testing
- Keywords: help, write, comprehensive, tests, swift, package
- Technologies: swift, testing
- Complexity Score: 0.19
- Confidence: 0.60
Agent Recommendations:
1. swift-testing-xcode-specialist (Score: 41%)
Why this agent?
Keyword overlap: 41% - Matched terms in agent description and tools
Agent capabilities:
- Description: Expert in Swift Testing framework integration with Xcode projects
- Tools: Read, Edit, Glob, Grep, Bash, MultiEdit
- Model: sonnet
Matching criteria:
- Agent has expertise in areas matching request intent (testing)
- Agent tools and description align with requested technologies
- Score reflects keyword overlap and weighted matching
2. swift-testing-specialist (Score: 28%)
[Similar detailed explanation...]
Matching Algorithm:
- Keyword-based analysis extracts intent, technologies, and keywords
- Agents scored by keyword overlap with name (3x weight), description (2x), and tools (1x)
- Top 2 agents selected by relevance score
- Foundation Models used for analysis when available (macOS 26+)
9. optimize_prompt - Intelligent Prompt Enhancement with Agent Injection
Flagship Feature: Intelligently rebuild prompts with contextual agent injection. Analyzes intent, matches relevant agents, and uses Foundation Models or template-based approach to inject @agent mentions directly into your prompt - making it immediately actionable.
💡 Key Benefits
- Cost Reduction - Better structured prompts reduce retries and token usage by eliminating ambiguity and providing clear direction from the start
- Context Preservation - Maintains clarity and focus throughout conversations with numbered agent workflows and explicit expertise areas
- Better Agent Routing - Explicit
@agent-{name}mentions guide Claude Code to invoke the right specialists immediately - Privacy-Preserving - All processing happens on-device with Foundation Models (macOS 26+) or keyword-based analysis (macOS 15+)
- Intelligent Workflow - Agents organized in logical sequences (architect → developer → tester) for complex multi-step tasks
Parameters:
prompt(string, required): The prompt to optimize and enhancecontext(string, optional): Additional context about the prompt's purposemax_agents(int, optional): Maximum number of agents to inject (default: 3, max: 10)inject_agents(bool, optional): Whether to inject agent mentions (default: true)
Basic Example:
{
"name": "optimize_prompt",
"arguments": {
"prompt": "I need to refactor my legacy Swift code",
"max_agents": 2
}
}
Returns:
# Enhanced Prompt
I need to refactor my legacy Swift code to modern Swift 6.0 patterns.
To accomplish this:
1. Use @agent-swift-modernizer for migrating legacy code to Swift 6.0
2. Employ @agent-swift-architect for architectural guidance on concurrency patterns
## Injected Agents
- @agent-swift-modernizer
- @agent-swift-architect
## Improvements Made
- Clarified modernization goal
- Specified target Swift version
- Matched 2 relevant agents
## Optimization Method
Template-based
## Analysis
- Intent: refactoring
- Technologies: swift, code, legacy
- Complexity: 0.35
Real-World Example: Server-Side API Development
Input:
{
"name": "optimize_prompt",
"arguments": {
"prompt": "Help me build a server-side Swift API with database integration",
"inject_agents": true,
"max_agents": 4
}
}
Output:
# Enhanced Prompt
I need help building a server-side Swift API with database integration.
Working on production iOS app with Swift 6.0, I should:
1. Use @agent-swift-mcp-server-writer to create MCP servers using Swift 6.
2. Employ @agent-hummingbird-developer for a lightweight Swift HTTP server using Hummingbird framework for modern APIs.
3. Leverage @agent-swift-grpc-temporal-developer for Swift gRPC v2 streaming and Temporal workflows for production services.
4. Utilize @agent-swift-server for server-side Swift development leveraging tech-conf-mcp for learning guidance.
These agents will assist in developing a robust and efficient server-side API.
## Injected Agents
- @agent-swift-mcp-server-writer
- @agent-hummingbird-developer
- @agent-swift-grpc-temporal-developer
- @agent-swift-server
## Improvements Made
- Analyzed intent: testing
- Matched 4 relevant agent(s)
- Used Foundation Models for intelligent rebuild
## Optimization Method
Foundation Models
## Analysis
- Intent: testing
- Technologies: database, swift, api, server
- Complexity: 0.20
## Original Prompt
Help me build a server-side Swift API with database integration
Why This Matters
Cost Reduction: Better structured prompts reduce token usage and minimize retry cycles. Clear agent routing from the start saves API calls.
Context Preservation: Agents are injected with clear numbered workflows, maintaining clarity across long conversations.
Intelligent Matching: Foundation Models (macOS 26+) understand semantic intent, not just keywords. Falls back gracefully to template-based injection on earlier macOS versions.
Privacy-First: All analysis and agent matching happens on-device using Apple Intelligence. No external API calls.
Immediate Action: The enhanced prompt includes @agent mentions that Claude Code can act on immediately, eliminating the need for manual agent discovery.
Advanced Usage
Disable Agent Injection (optimization only):
{
"name": "optimize_prompt",
"arguments": {
"prompt": "Explain quantum computing",
"inject_agents": false
}
}
With Context (better agent matching):
{
"name": "optimize_prompt",
"arguments": {
"prompt": "Add tests to my code",
"context": "Swift package using Swift Testing framework, not XCTest",
"max_agents": 2
}
}
Returns:
# Enhanced Prompt
Add comprehensive tests to my Swift package code.
Context: Swift package using Swift Testing framework, not XCTest
Recommended approach:
1. Use @agent-testing-specialist for Swift Testing framework expertise
2. Employ @agent-swift-testing-xcode-specialist for Xcode test configuration
## Injected Agents
- @agent-testing-specialist
- @agent-swift-testing-xcode-specialist
## Improvements Made
- Integrated provided context
- Specified testing framework (Swift Testing, not XCTest)
- Matched 2 testing specialists
## Optimization Method
Template-based
## Analysis
- Intent: testing
- Technologies: swift, code, testing, framework
- Complexity: 0.28
How It Works
- Request Analysis: Analyzes prompt using Foundation Models or keyword-based analyzer
- Agent Discovery: Scans
~/.claude/agents/for available specialists - Smart Matching: Scores agents by relevance to intent and technologies
- Intelligent Rebuild: Uses Foundation Models (preferred) or template-based approach to restructure prompt with agent workflow
- Contextual Injection: Agents are integrated naturally with numbered steps explaining their expertise
Optimization Methods
Foundation Models (macOS 26+):
- Semantic understanding of intent
- Natural language prompt reconstruction
- Contextual agent expertise descriptions
- Best quality, ~100-500ms latency
Template-Based (macOS 15+):
- Deterministic workflow generation
- Keyword-based agent matching
- Structured numbered lists
- Fast and reliable, <10ms latency
Both methods provide immediate value - the enhanced prompt is ready to use with agents already injected.
Development
Build
swift build
Test
swift test
Code Formatting
# Lint
swift format lint -s -p -r Sources Tests Package.swift
# Auto-fix formatting
swift format format -p -r -i Sources Tests Package.swift
Run with Debug Logging
swift run prompteneer --log-level debug
Manual MCP Protocol Test
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | prompteneer
Architecture
Prompteneer MCP Server
├── LocalLLMMCP.swift # Main entry point (@main with ArgumentParser)
├── MCPServer.swift # Actor-based MCP protocol handler
├── Models/
│ ├── Agent.swift # Agent domain models
│ ├── FoundationModelsTypes.swift # @Generable types for structured output
│ ├── QueryOptions.swift # Legacy LLM request parameters
│ ├── LLMResult.swift # Legacy LLM response types
│ └── Errors.swift # Error definitions
└── Services/
├── FoundationModelsManager.swift # Actor for Apple Intelligence
├── KeywordBasedAnalyzer.swift # Actor for fallback analysis
├── KeywordBasedMatcher.swift # Actor for agent matching
├── AgentDiscovery.swift # Actor for agent discovery
├── LLMEngine.swift # Legacy AI inference engine
└── PIIDetector.swift # Privacy scanner with regex
Key Architectural Patterns
- Actor-Based Concurrency: All services are actors for Swift 6.0 strict concurrency
- Hybrid Strategy: Foundation Models primary path with keyword-based fallback
- Single-Process Design: All actors in same process, no IPC overhead
- MCP Swift SDK 0.9.0+: Type-safe tool definitions with JSON schema
- Graceful Degradation: Automatic fallback when Foundation Models unavailable
Current Implementation Status
Phase 1: Agent Orchestration (Complete ✅)
- ✅ MCP server with 9 tools (4 legacy + 5 agent orchestration)
- ✅ Foundation Models integration (macOS 26+)
- ✅ Keyword-based fallback (macOS 15+)
- ✅ Agent discovery from
~/.claude/agents/ - ✅ Request analysis with intent/technology detection
- ✅ Agent matching with relevance scoring
- ✅ Routing explanation with reasoning
- ✅ Intelligent prompt optimization with agent injection (Flagship Feature)
- ✅ Comprehensive test suite (56/56 tests passing)
- ✅ Actor-based Swift 6.0 concurrency
- ✅ Error handling and structured logging
Phase 2: Enhanced Intelligence (Future ⏳)
- ⏳ Foundation Models tool calling
- ⏳ Multi-agent workflow orchestration
- ⏳ Advanced capability matching
- ⏳ Performance optimizations
- ⏳ Analytics and usage tracking
See .agent-workspace/ for detailed Phase 1 documentation.
Integration with OwlPing
Prompteneer is designed to work alongside OwlPing:
- OwlPing: Notifications, sessions, bidirectional communication
- Prompteneer: Agent orchestration, request analysis, intelligent routing
Both run as separate MCP servers in Claude Code. Example workflow:
- Use Prompteneer to analyze a request and match specialized agents
- Invoke the recommended agent for task execution
- Send notifications via OwlPing when tasks complete
Privacy Guarantees
- ✅ 100% on-device processing
- ✅ No network requests to external services
- ✅ No data collection or telemetry
- ✅ PII detection helper for data sanitization
- ✅ Open-source and auditable
Troubleshooting
Server Not Found
# Verify installation
which prompteneer
# Should output: /Users/[username]/.swiftpm/bin/prompteneer
# Verify it runs
prompteneer --version
# Should output: prompteneer 0.0.1
MCP Connection Issues
Check Claude Code logs:
tail -f ~/Library/Logs/Claude/mcp-server-prompteneer.log
Test the MCP protocol directly:
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | prompteneer
Foundation Models Not Available
If you see "Foundation Models available: false" in logs:
- Requires macOS 26.0+ for Foundation Models
- Falls back automatically to keyword-based analysis on macOS 15+
- Both methods provide agent orchestration capabilities
No Agents Found
# Check agents directory
ls -la ~/.claude/agents/
# Install agents using claude-agents CLI
claude-agents install swift-architect swift-developer --global
Build Errors
# Clean build
rm -rf .build
swift build
# Check Swift version
swift --version
# Requires Swift 6.0+
Contributing
This project is part of the OwlPing ecosystem. See main repository for contribution guidelines.
License
MIT License - See LICENSE file for details.
Links
- OwlPing Repository: https://github.com/doozMen/owlping
- Prompteneer Repository: https://github.com/doozMen/prompteneer
- MCP Protocol: https://modelcontextprotocol.io
- Swift SDK: https://github.com/modelcontextprotocol/swift-sdk
Built with privacy in mind. All AI processing stays on your device.