Oldowan Framework

@elite-agents/oldowan 🪨

Oldowan is a library for building monetizable AI tools with the Model Context Protocol (MCP), named after humanity's first stone tool technology. It provides abstractions to simplify tool development while handling protocol communication and validation automatically.

Features

  • 🛠️ Zero-config server setup for MCP tooling

  • 🌐 REST API wrapping with OpenAPI 3.0 specifications support for existing endpoints

  • 📦 Type-safe tool development with TypeScript

  • 🪙 Monetization support with token-gated, subscription, and credit-based access

  • ⚡ Cloudflare Workers for blazingly fast deployment

Installation

# Using bun:
bun add @elite-agents/oldowan

Quick Start

  1. Create a Tool (src/tools/weather.ts):

import { OldowanTool } from '@elite-agents/oldowan';
import { z } from 'zod';

export const weatherTool = new OldowanTool({
  name: 'get_weather',
  description: 'Get current weather conditions',
  schema: {
    location: z.string().describe('City name or postal code'),
    unit: z.enum(['celsius', 'fahrenheit']).optional(),
  },
  async execute({ location, unit }) {
    // Example API call
    const response = await fetch(`https://api.weather.com/${location}`);
    const data = await response.json();
    return {
      temp: data.current.temp,
      unit: unit || 'celsius',
      conditions: data.current.conditions,
    };
  },
});
  1. Set Up Server (src/server.ts):

  1. Run your service:

REST API Wrapping with OpenAPI Support

Oldowan can wrap existing REST APIs into MCP-compatible tools with OpenAPI 3.0 specifications. This enables proper documentation and type safety for your API endpoints.

Key Concepts

Tool Development

Define tools with:

  • Name: Unique tool identifier

  • Description: Natural language explanation

  • Schema: Zod validation rules

  • Execute: Core tool functionality

  • Payment Details: Optional payment configuration

Server Features

  • Uses the latest stateless MCP specification

  • Deploys as a Cloudflare Worker

Error Handling

Oldowan automatically:

  • Validates inputs against Zod schemas

  • Converts errors to MCP-compatible format

  • Provides detailed error messages in responses

Monetization Examples

Oldowan supports built-in monetization via the paymentDetails field. See Monetization Guide for full details.

Token-Gated

Subscription

Credit-Based

API Reference

ED25519_ALGORITHM_IDENTIFIER

Constant identifier for the Ed25519 algorithm when using the Web Crypto API. Use with crypto.subtle.generateKey, crypto.subtle.importKey, etc.

generateKeypairRawBytes

Generates a new Ed25519 keypair and returns a 64-byte Buffer with [publicKey (32 bytes) || privateKey (32 bytes)]. Useful for creating key pairs for signing tool calls.

OldowanServer

RestApiWrappedOldowanServer

OldowanTool

OldowanTool Example

Last updated