https://github.com/neoapps-dev/modai
Modular AI Protocol, alternative to MCP.
https://github.com/neoapps-dev/modai
Last synced: 9 months ago
JSON representation
Modular AI Protocol, alternative to MCP.
- Host: GitHub
- URL: https://github.com/neoapps-dev/modai
- Owner: neoapps-dev
- License: mit
- Created: 2025-07-27T18:05:43.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-30T20:42:50.000Z (11 months ago)
- Last Synced: 2025-09-01T11:57:05.133Z (10 months ago)
- Language: TypeScript
- Homepage:
- Size: 227 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modai
**Modai** is a modern, TypeScript-powered framework that enables large language models (LLMs) to interact with the real world via extendable "tools"βlike running shell commands or reading files. Designed for safety, flexibility, and developer delight.
---
## β¨ Features
- **Multi-provider LLM support:** OpenAI, Claude, Ollama, and custom endpoints.
- **Pluggable, secure tools:** Run system commands, access the filesystem, automate anything.
- **Protocol-driven:** All interactions flow through a predictable JSON protocol for tool use.
- **Easy extension:** Add your own tools or providers with simple base classes.
- **Contextual awareness:** Seamlessly pipes tool results into LLM conversations.
- **Built in TypeScript:** Type safety out-of-the-box, ready for Node.js or via CLI.
---
## π¦ Installation & Setup
### Method 1: NPM (recommended)
```sh
pnpm i -g modai-framework # or npm. also no need for -g (--global) if you want it to be project-level.
```
done. lol..
### Method 2: Clone the repository and install dependencies
```sh
git clone https://github.com/neoapps-dev/modai.git
cd modai
pnpm install # or: npm install # choose your package manager
```
Build the TypeScript project:
```sh
pnpm run build # or: npm run build
```
You can now use Modai via CLI or import it in local projects using:
```typescript
import { Modai } from "./src";
```
(Adjust the `import` path depending on where/how you use the framework.)
---
## π Quick Start
```typescript
import { Modai } from "./src";
const modai = new Modai({
provider: "openai", // Also supports "claude", "ollama", "custom"
apiKey: "YOUR_API_KEY", // Needed for OpenAI/Claude
model: "gpt-4.1", // Model selection
// Optionally add: baseUrl, name, etc
});
// Chat with an LLM agent
const response = await modai.chat("List files in the current directory.");
// (Optional) Automatically extract and run any tool requests:
const toolResults = await modai.extractAndExecuteTools(response);
for (const { tool, result } of toolResults) {
if (result.success) {
console.log(`> ${tool}:`, result.data);
}
}
// Or: Directly invoke a tool (scripting/programmatic use)
const execResult = await modai.processRequest({
protocol: "modai",
tool: "exec",
arguments: { command: "ls -la" },
});
console.log(execResult.data.stdout);
```
---
## π οΈ Core Tools
- **`exec`** β Run system shell commands (with output capture)
- **`file`** β Read, write, and list files/folders
- **`registry`** β Utility for plugin/tool loading
## π€ Supported LLM Providers
- **OpenAI** (ChatGPT, GPT-4)
- **Anthropic Claude**
- **Ollama** (local open-source models)
- **Custom**: Point to any compatible LLM API
---
## π§© Extending Modai
**To add a new provider:**
- Implement a provider in `src/providers/` extending `BaseProvider`
**To add a new tool:**
- Create a file in `src/tools/`, extending `BaseTool`
- Register it in your config
**Example: Custom Tool**
[this](https://github.com/neoapps-dev/modai-echo). Can be installed via `/install neoapps-dev/modai-echo` or ask the LLM to install it :)
---
## π‘ Example Use Cases
- AI developer agents (automate code, DevOps, builds, refactoring)
- Smart LLM-driven automation on local or cloud systems
- Chatbots with tool-use and access to real data
- Autonomous research, writing, document analysis
---
## π€ Contributing
PRs, feedback, and issues welcome!
- Fork, branch, modify, and submit a Pull Request
- Describe your changes, tests appreciated!
---
## π License
MIT License
**Made with β€οΈ and TypeScript by [@neoapps-dev](https://github.com/neoapps-dev)**