The MCP-PIF server enables structured human-AI interaction through filesystem management, reasoning tools, and journaling.
- Filesystem Operations: Navigate and manage files (
cd
,ls
,pwd
), create directories (mkdir
), and perform file operations like reading (read
), writing/modifying (write
), renaming (rename
), moving (move
), and deleting (delete
). - Reasoning Tools: Develop connected insights (
reason
) and create temporal spaces for contemplation (think
). - Journal System: Document developments (
journal_create
) and explore patterns in journal entries (journal_read
) based on date ranges or tags. - Cross-Platform Support: Works seamlessly on Windows, macOS, and Linux with automatic path normalization.
- Extensible Architecture: Supports progressive development through a modular design that allows for tool development and framework extension.
MCP-PIF-CLJS: A Self-Modifying MCP Server
A Model Context Protocol (MCP) server written in ClojureScript that explores homoiconicity, introspection, and metaprogramming to enable runtime tool creation and safe self-modification capabilities. It allows models like Claude to create and execute new tools during runtime without restarting the server. For example, tools for arithmetic can perform actual calculations, not LLM approximations based on pattern matching.
It leverages Clojure's code-as-data philosophy known as homoiconicity, is designed to block dangerous operations, and all modifications are journaled and auditable.
🚀 Quick Start
Prerequisites
- Node.js 16+
- Java 11+ (for ClojureScript compiler)
Installation
- Clone and build:
- Configure Claude Desktop:Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Restart Claude Desktop
Building a .dxt Package
For easier use and distribution, you can create a .dxt package:
This creates mcp-pif-cljs.dxt
which can be installed via drag-and-drop in Claude Desktop.
🛠️ Available Tools
Base Tools
memory-store
- Store key-value pairs in memorymemory-retrieve
- Retrieve stored valuesjournal-recent
- View recent activity journalserver-info
- Get comprehensive server information (all tools, state, statistics)
Meta-Programming Tools
meta-evolve
- Create new tools at runtimeexecute-tool
- Execute any tool by name (including dynamic ones)
💡 Example Usage
Basic Memory Storage
Creating Custom Tools
The Dynamic Tool Workflow
Due to MCP client caching, newly created tools must be called via execute-tool
:
- Create a tool:
- Verify creation:
- Execute the tool:
🏗️ Architecture
Project Structure
🔒 Safety Mechanisms
- Sandboxed Execution: Limited to arithmetic and string operations
- Code Validation: Blocks dangerous operations (file system, network, process)
- Namespace Protection: Core namespaces cannot be modified
- Activity Journal: All actions are logged and auditable
- Session-Only: Changes don't persist between restarts
🧪 Development
Testing the Server
🎯 Philosophy
This project explores the intersection of:
- Homoiconicity: Code as data, data as code
- Self-Reference: A system that can reason about itself
- Controlled Evolution: Safe boundaries for self-modification
- Human-AI Collaboration: AI proposes, human uses
📋 Roadmap
Completed:
- Basic MCP server in ClojureScript
- Runtime tool creation
- Universal tool executor (workaround for client caching)
- .dxt packaging support
In progress:
- Tool composition (tools that use other tools)
- Namespace evolution
- Import capabilities from other MCP servers
- Persistent tool storage
⚠️ Important Notes
- Tool Persistence: Tools only exist while server is running
- Client Caching: Use
execute-tool
to call runtime-created tools - Real Computation: Tools execute actual code, not LLM approximations
🤝 Contributing
This is an experimental project exploring metaprogramming in the context of AI tools. Contributions that enhance self-modification capabilities or improve safety are welcome!
📄 License
MIT
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." - Einstein
This project asks: What if our tools could evolve their own thinking?
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
This server implements the Model Context Protocol to facilitate meaningful interaction and understanding development between humans and AI through structured tools and progressive interaction patterns.
- Overview
- Quick Start
- Core Implementation
- Cross-Platform Support
- Implementation Framework
- Theoretical Foundation
- Development Paths
- Contributing
- Documentation
- Future Directions
- Philosophy
- Notes on Usage
Related Resources
Related MCP Servers
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -31TypeScript
CodeAlive MCPofficial
-securityAlicense-qualityA Model Context Protocol server that enhances AI agents by providing deep semantic understanding of codebases, enabling more intelligent interactions through advanced code search and contextual awareness.Last updated -47PythonMIT License- -securityAlicense-qualityA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.Last updated -28TypeScriptMIT License
- -securityFlicense-qualityA basic Model Context Protocol server implementation that demonstrates core functionality including tools and resources for AI chat applications.Last updated -Python