New:Socket for Asana Is Now Available.Learn more
Get Started

@agentforge-ai/core

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentforge-ai/core

Core agent primitives, sandbox integration, and MCP server for AgentForge

Source
npmnpm
Version
0.12.12
Version published
Weekly downloads
8
-92.38%
Maintainers
1
Weekly downloads
 
Created
Source

@agentforge-ai/core

Core agent primitives, secure sandbox execution, and MCP server for the AgentForge framework.

Installation

npm install @agentforge-ai/core

Quick Start

import { Agent, SandboxManager, MCPServer } from '@agentforge-ai/core';

// Create an agent
const agent = new Agent({
  id: 'my-agent',
  name: 'My Agent',
  instructions: 'You are a helpful assistant.',
  model: 'openai/gpt-4o-mini',
});

// Generate a response
const response = await agent.generate('Hello, world!');

// Execute code securely
const sandbox = new SandboxManager({ timeout: 10000 });
const result = await sandbox.runCode('console.log("Hello from sandbox!")');

// Register tools with MCP
const mcp = new MCPServer();
mcp.registerTool({
  name: 'calculator',
  inputSchema: z.object({ expression: z.string() }),
  outputSchema: z.string(),
  handler: async ({ expression }) => eval(expression).toString(),
});

API Reference

Agent

The core agent class wrapping Mastra for AI orchestration.

  • new Agent(config) - Create a new agent
  • agent.generate(prompt) - Generate a response
  • agent.stream(prompt) - Stream a response

SandboxManager

Secure code execution via E2B sandboxes.

  • new SandboxManager(config) - Create a sandbox manager
  • manager.runCode(code, options) - Execute code securely
  • manager.cleanup() - Clean up resources

MCPServer

Model Context Protocol server for tool communication.

  • new MCPServer() - Create an MCP server
  • server.registerTool(tool) - Register a tool
  • server.listTools() - List all tools
  • server.callTool(name, input) - Call a tool

License

Apache-2.0

Keywords

ai

FAQs

Package last updated on 06 Mar 2026

Related posts