HM

hungryrobot1/mcp-pif

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

57 stars 17 forks 품질 38 트렌드 13

배고픈로봇1/mcp-pif는 MCP 서버 후보가에서 가져온 https://github.com/hungryrobot1/mcp-pif.]

개요

배고픈로봇1/mcp-pif는 MCP 서버 후보가에서 가져온 https://github.com/hungryrobot1/mcp-pif.]

개요(AI 번역)

JSON-native lambda calculus runtime with metacircular assessment, MCP (모델 Context Protocol) 서버로 설계. metaprogramming을 통해 동적 도구로 진화하는 언어 모델을 활성화합니다.

빠른 시작

기본 예제

핵심 개념

문제

순수한 계산 언어 모델은 계산 도구가 필요하지만 기존 시스템은 고정 API 또는 제한되지 않은 코드 실행을 제공합니다. metaprogramming 및 self-modification의 컨텍스트에서 이상은 없습니다. 이 프로그램은 안전한, 검사할 수 있는, evolvable 계산을 위한 중간 지상 구조를 선물합니다.

이상적인 감각에서 MCP-PIF는 일반적, 메타형 컴퓨터 인터페이스로 생각할 수 있으며, 언어 모델이 떨어질 때의 임원 기능으로 생각할 수 있습니다. 여기에, 우리는 순수한 컴퓨팅에만 액세스 할 수있는 lambda calculus primitives의 간단한 어휘를 제공합니다.

솔루션

MCP-PIF는 3개의 metaprogramming primitives를 가진 lambda calculus를 제공합니다:

  • quote - 데이터로 처리 코드 (이전 평가) -eval - 동적으로 인용된 코드 실행
  • code_of - 어떤 도구의 소스 코드를 소개

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MCP-PIF

A JSON-native lambda calculus runtime with metacircular evaluation, designed as an MCP (Model Context Protocol) server. Enables language models to evolve tools dynamically through metaprogramming.

Quick Start

# Build the project
cabal build

# Enable debug mode for detailed evaluation tracing
MCP_DEBUG=1 cabal run mcp-pif
# Debug output (to stderr) shows:
# - Each evaluation step
# - Environment keys at each step
# - Closure creation and application
# - Tool code lookups

Basic Example

// Create a tool
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "evolve",
    "arguments": {
      "name": "square",
      "description": "Squares a number",
      "code": {"lam": "x", "body": {"mul": [{"var": "x"}, {"var": "x"}]}}
    }
  }
}

// Use the tool
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "tool": "square",
      "input": 7
    }
  }
}
// Returns: 49

// Get help
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "help",
    "arguments": {"category": "lists"}
  }
}
// Returns: Documentation for list primitives

Core Concepts

The Problem

For pure computation language models need computational tools, but existing systems either provide fixed APIs or unrestricted code execution. In the context of metaprogramming and self-modification, neither is ideal. This program presents a middle ground structure for safe, inspectable, evolvable computation.

In the ideal sense, MCP-PIF can be thought of as a generic, metamorphic computer interface where the language model drops-in as an executive function. Here, we provide a simple vocabulary of lambda calculus primitives for access to pure computing only.

The Solution

MCP-PIF provides a lambda calculus with three metaprogramming primitives:

  • quote - Treat code as data (prevent evaluation)
  • eval - Execute quoted code dynamically
  • code_of - Introspect any tool’s source code

This creates a metacircular system where tools can analyze and transform other tools while maintaining deterministic, fuel-bounded execution. It is homoiconic, but constrained.

It’s worth noting quote and eval are not perfectly symmetric:

-- eval cleans the environment:
let cleanEnv = M.filterWithKey (\k _ -> not $ k `elem` ["__tool_name", "__self"]) env

This prevents eval’d code from inheriting the wrong tool context. When eval executes quoted code:

  • User variables ARE preserved (lexical scoping maintained)
  • System variables are cleaned (__tool_name and __self removed to prevent tool context confusion)
  • Tool codes remain available (for code_of introspection)
  • __eval_depth counter is added (max depth: 100, prevents infinite eval loops)

The Event Horizon

GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →