You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sources/platform/integrations/ai/mastra.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Mastra integration
3
3
sidebar_label: Mastra
4
-
description: Learn how to build AI Agents Mastra using Apify MCP server
4
+
description: Learn how to build AI Agents with Mastra using Apify MCP server
5
5
sidebar_position: 1
6
6
slug: /integrations/mastra
7
7
---
@@ -18,9 +18,9 @@ slug: /integrations/mastra
18
18
See the [Mastra docs](https://mastra.ai/docs) for more.
19
19
:::
20
20
21
-
## What MCP server
21
+
## What is MCP server
22
22
23
-
An[Model Context Protocol](https://modelcontextprotocol.io) (MCP) server exposes specific data sources or tools to agents via a standardized protocol. It acts as a bridge, connecting large language models (LLMs) to external systems like databases, APIs, or local filesystems. Built on a client-server architecture, MCP servers enable secure, real-time interaction, allowing agents to fetch context or execute actions without custom integrations. Think of it as a modular plugin system for agents, simplifying how they access and process data. Apify provides [Actors MCP Server](https://apify.com/apify/actors-mcp-server) to expose [Apify Actors](https://docs.apify.com/platform/actors) from the [Apify Store](https://apify.com/store) as tools via the MCP protocol.
23
+
A[Model Context Protocol](https://modelcontextprotocol.io) (MCP) server exposes specific data sources or tools to agents via a standardized protocol. It acts as a bridge, connecting large language models (LLMs) to external systems like databases, APIs, or local filesystems. Built on a client-server architecture, MCP servers enable secure, real-time interaction, allowing agents to fetch context or execute actions without custom integrations. Think of it as a modular plugin system for agents, simplifying how they access and process data. Apify provides [Actors MCP Server](https://apify.com/apify/actors-mcp-server) to expose [Apify Actors](https://docs.apify.com/platform/actors) from the [Apify Store](https://apify.com/store) as tools via the MCP protocol.
24
24
25
25
## How to use Apify with Mastra via MCP
26
26
@@ -45,7 +45,7 @@ Since we are using the MCP server, we do not have to make any code changes and c
45
45
46
46
### Building the TikTok profile search and analysis agent
47
47
48
-
First import all required packages:
48
+
First, import all required packages:
49
49
50
50
```typescript
51
51
import { Agent } from'@mastra/core/agent';
@@ -97,7 +97,7 @@ Instantiate the agent with the OpenAI model:
97
97
98
98
```typescript
99
99
const agent =newAgent({
100
-
name: 'TikTokAnalyzer',
100
+
name: 'Social Media Agent',
101
101
instructions: 'You’re a social media data extractor. Find TikTok URLs and analyze profiles with precision.',
102
102
model: openai('gpt-4o-mini')
103
103
});
@@ -120,7 +120,7 @@ console.log(response.text);
120
120
awaitmcpClient.disconnect();
121
121
```
122
122
123
-
Before running the agent we need to start the Apify MCP Server by sending a request:
123
+
Before running the agent, we need to start the Apify MCP Server by sending a request:
0 commit comments