Overview

Build supportive microservice-like functionality that lives within AI Agents and MCP Tools.


Services provide additional capabilities, APIs for custom interaction, admin functionality, and specialized processing that enhances your agent's core abilities.

What are Services?

Services are modular components that provide supportive functionality or microservices within the TypeScript Agent Framework. They can:

  • Expose APIs for custom interaction or admin functionality
  • Provide specialized processing capabilities
  • Manage resources and handle complex operations
  • Integrate with external systems seamlessly
  • Offer reusable functionality and state across multiple agents

Services live within AI Agents or MCP Tools and can be enabled or disabled as needed for different use cases.

Default Service Types

Toolbox Service

Toolbox Service bootstraps mcp.json files into usable tools for the agent.

Service Architecture

Services in the TypeScript Agent Framework extend the base Service class and are registered within the agent class constructor. Once registered, they get bootstrapped as middleware, external services or generic services.

Creating a Hello World Service

typescript

Agent Implementation with Service

typescript

Service Configuration

Services need access to environment variables and can be configured in two ways:

Option 1: Using this.env (Recommended)

typescript

Option 2: Using process.env

If you need to use process.env instead of this.env, you must enable the nodejs_compat flag. See Environment Variables documentation for setup instructions.

typescript

MCP Tools Integration

Service support for MCP Tools is coming soon!

Default Available Services

Official Documentation