npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mozi-agent

v0.0.2

Published

A TypeScript-based OpenAI headless agent for Model Context Protocol

Readme


🧠 TT AI Agent

A headless AI agent framework built for LLM applications. Features include:

  • ✅ Configurable OpenAI-compatible API providers (e.g., OpenRouter)
  • ✅ Pluggable model support (ChatGPT, DeepSeek, etc.)
  • ✅ MCP (Model Context Protocol) server integration for custom tools (e.g., fetch weather, call CLI tools)

🏗️ Architecture

Architecture documentation coming soon.

Agent (context)

  • create mcp clients
  • create openai client

🚀 Getting Started

📦 Install

npm install tt-ai-agent

🛠️ Usage

👉 Ask a Single Question

import Bot from 'tt-ai-agent/bot';

const bot = new Bot();
const answer = await bot.ask('What is the capital of France?');
console.log(answer);

💬 Start an Interactive Chat

import Bot from 'tt-ai-agent/bot';

const bot = new Bot();
await bot.chat();

⚙️ Example: aiconfig.json

Customize your agent with API provider info, model selection, and MCP integration:

{
  "apiProvider": {
    "apiKey": "sk-this-will-be-replaced-by-env",
    "apiBaseURL": "https://openrouter.ai/api/v1"
  },
  "model": "deepseek/deepseek-chat-v3-0324:free",
  "mcpServers": {
    "slack-mcp": {
      "disabled": false,
      "command": "node",
      "args": [
        "C:/Workspace/ai/slack-mcp-server/build/index.js"
      ]
    }
  }
}

FAQ

Certainly! Here's the translated version of the error message and full explanation:


❗ Error

[ERRR] Error invoking agent: Error: 429 Rate limit exceeded: free-models-per-day. Add 10 credits to unlock 1000 free model requests per day

💡 Cause:

You're using the OpenRouter API and calling a free model (like deepseek). These free models have a daily request limit.

HTTP status code 429 means Too Many Requests — you've exceeded your daily quota.


✅ How to Fix

1. Sign up / log in to OpenRouter

Go to https://openrouter.ai/ and log in with your account.


2. Add $10 in credits

Once you add at least $10 in credits, you unlock 1000 free requests per day for free-tier models.

  • Supports credit cards, crypto, etc.
  • Your funds won’t be consumed unless you exceed free quotas — the credit just unlocks the daily limits.

3. (Alternative) Use a different model

You could switch to another model with fewer restrictions, but free models usually have similar limitations or may be less reliable.


4. Monitor your usage

You can check your usage and quota at the OpenRouter dashboard: https://openrouter.ai/dashboard


🔐 Best Practice: Use Environment Variables for API Keys

Use a .env file to store your API key securely:

OPENROUTER_API_KEY=your-openrouter-key

Then load it in your code:

import 'dotenv/config';

const apiKey = process.env.OPENROUTER_API_KEY;

If you’ve already added credits but still get the error, double-check:

  • That you're using the correct API key (from a funded account)
  • Your headers are correctly passing the key
  • Your daily usage hasn't actually exceeded the 1000 requests

If you'd like me to help review your request code or configuration, feel free to share it!


🧪 For Developers

🧰 Project Setup

npm init -y

Install Runtime Dependencies

npm install dotenv openai chalk @modelcontextprotocol/sdk

Install Development Dependencies

npm install --save-dev typescript  @types/node 

npm install --save-dev jest ts-jest @types/jest

⚙️ TypeScript Config

npx tsc --init

Update tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "declaration": true,
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": ["src"]
}

🛠 Build the Project

npx tsc

▶️ Run the Project

node dist/index.js

🚀 Unit Tests

npx jest
  "scripts": {
    "test": "jest"
  },

then

npm test

🚀 Create a CLI Tool

In package.json:

{
  "bin": {
    "my-openai-agent": "dist/cli.js"
  },
  "exports": {
    ".": "./dist/main.js",
    "./McpClient": "./dist/McpClient.js"
  },
  "files": ["dist"]
}

In cli.ts, add the shebang line:

#!/usr/bin/env node

Then:

npx tsc
npm pack

📦 Publish to npm (optional)

npm login
npm publish --access=public

🔧 Tech Stack

  • 🟦 Node.js
  • 🟨 TypeScript
  • ☁️ OpenAI & compatible APIs
  • 🔌 MCP SDK