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
@@ -18,7 +18,7 @@ You can try out Taskmaster [here](https://taskmaster-speakeasyapi.vercel.app/).
18
18
Taskmaster is a full-stack CRUD application for tasks and projects. It includes:
19
19
20
20
- A web UI for managing projects and tasks
21
-
- A built-in HTTP API
21
+
- A built-in HTTP API
22
22
- OAuth 2.0 authentication
23
23
- A Neon PostgreSQL database for storing tasks and projects
24
24
@@ -35,11 +35,11 @@ To follow this tutorial, you need:
35
35
36
36
## Setting up a Gram project
37
37
38
-
In the [Gram dashboard](https://app.getgram.ai), click **New Project** to start the guided setup flow for creating a toolset and MCP server.
38
+
On the [Gram dashboard](https://app.getgram.ai), click your username in the bottom-left corner and then open the projects dropdown. Select **+ New Project**, enter a project name, and click **Submit**.
39
39
40
-

40
+

41
41
42
-
Enter a project name and click**Submit**.
42
+
Click **Get Started**and select**Start from API** to start the guided setup flow for creating a toolset and MCP server.
43
43
44
44
Gram will then guide you through the following steps:
45
45
@@ -51,7 +51,7 @@ Upload the [Taskmaster OpenAPI document](https://github.com/speakeasy-api/taskma
51
51
52
52
### 2. Create a toolset
53
53
54
-
Give your toolset a name (for example, `Taskmaster`) and click **Continue**.
54
+
Give your toolset a name (for example, `Taskmaster`) and click **Continue**.
55
55
56
56

57
57
@@ -67,18 +67,18 @@ Gram then creates the toolset from the OpenAPI document.
67
67
68
68
Click **Toolsets** in the sidebar to view the **Taskmaster** toolset.
69
69
70
-

70
+

71
71
72
72
As you can see, the toolset needs environment variables before you can use it.
73
73
74
74
## Getting a Taskmaster API key
75
75
76
76
Before configuring environment variables, create an API key:
77
77
78
-
- Navigate to your Taskmaster app (for example, `https://taskmaster-ritza.vercel.app`).
78
+
- Navigate to your Taskmaster app (for example, `https://taskmaster-speakeasyapi.vercel.app`).
79
79
- Sign in and go to **Settings → Developer**.
80
-
- Under **API Keys**, click **New Key**.
81
-
- Give it a label and click **Create**.
80
+
- Under **API Keys**, click **+ New**.
81
+
- Give it a label and click **Generate Key**.
82
82
- Copy the API key. You will not be able to see it again.
83
83
84
84
<videowidth="600"muted={true}controls>
@@ -90,37 +90,36 @@ Before configuring environment variables, create an API key:
90
90
91
91
[Environments](/docs/gram/concepts/environments) store API keys and configuration separately from your toolset logic.
92
92
93
-
In the **Environments** tab, click the **Default** environment. Click the three-dot menu in the top-right corner of the environment card, and in the dropdown, click **Fill for Toolset**. Select the **Taskmaster** toolset and click **Fill Variables** to automatically populate the required variables.
93
+
In the **Environments** tab, click the **Default** environment. Click **Fill for Toolset**. Select the **Taskmaster** toolset and click **Fill Variables** to automatically populate the required variables.
94
94
95
-

95
+

96
96
97
97
Configure the following environment variables:
98
98
99
-
- Set the `TASKMASTER_SERVER_URL` environment variable to your API base URL. For example: `https://taskmaster-ritza.vercel.app/api`
100
-
- Set the `TASKMASTER_ACCESS_TOKEN` environment variable to your API key. For example: `tm_abc123_def456`
101
-
Alternatively, you can set an `X-API-Key` header to the same value. The API accepts both.
99
+
- Set the `TASKMASTER_SERVER_URL` environment variable to your API base URL. For example: `https://taskmaster-speakeasyapi.vercel.app/api`
100
+
- Set the `TASKMASTER_API_KEY` environment variable to your API key. For example: `tm_abc123_def456`
102
101
103
-
Click **Update** and then **Save**.
102
+
Click **Save**.
104
103
105
-

104
+

106
105
107
106
## Publishing an MCP server
108
107
109
108
Let's make the toolset available as an MCP server.
110
109
111
-
Go to the **MCP** tab, find the **Taskmaster** toolset, and click on it to open the MCP details page.
110
+
Go to the **MCP** tab, find the **Taskmaster** toolset, and click on it to open the **MCP Details** page.
112
111
113
-
Scroll down to the **Visibility** section and tick the **Public** checkbox.
112
+
To enable the server, click **Enable**, and then in the modal that opens, click **Enable Server**.
114
113
115
-

114
+
Scroll down to the **Visibility** section and select the **Public** checkbox.
116
115
117
-
Next, you'll need to copy the MCP server configuration.
116
+

118
117
119
-
Scroll down to the **MCP Config** section and copy the **Public Server** configuration.
118
+
Next, you'll need to copy the MCP server configuration.
120
119
121
-

120
+
Scroll down to the **MCP Installation** section and click the **View** button to open the configuration details page.
122
121
123
-
The configuration looks something like this:
122
+
If you set the visibility to **Public**, the configuration will look something like this:
124
123
125
124
```json
126
125
{
@@ -131,20 +130,22 @@ The configuration looks something like this:
Use the **Authenticated Server** configuration if you want to use the MCP server in a private environment.
144
-
145
-
You need an API key to use an authenticated server. Generate an API key in the Taskmaster **Settings → Developer → API Keys** page, copy it, and paste it in the `GRAM_KEY` environment variable in place of `<your-key-here>`.
146
+
If you set the visibility to private, you will need a Gram API key to connect to the server. You can generate an API key under **Settings → New API Key** in the Gram dashboard, copy it, and paste it in the `GRAM_KEY` environment variable in place of `<your-key-here>`.
146
147
147
-
The authenticated server configuration looks something like this:
148
+
The configuration using the Gram key looks something like this:
148
149
149
150
```json
150
151
{
@@ -155,18 +156,114 @@ The authenticated server configuration looks something like this:
While the tools generated from your OpenAPI document handle basic CRUD operations, you can extend your MCP server with custom logic using [Gram Functions](/docs/gram/concepts/functions). This is useful for adding business logic that goes beyond simple API calls.
175
+
176
+
For example, let's add a function that sends email reminders to users about their pending tasks. We'll use [Resend](https://resend.com) for sending emails. You can sign up for a free account and get an API key from their dashboard.
The code above creates a function called `send_email` that accepts an email address, task title, and description as validated inputs using Zod schemas. The function uses the Resend API to send formatted HTML emails, with comprehensive error handling using `ctx.fail()` to return structured error responses with appropriate HTTP status codes, and `ctx.json()` to return successful results with the email message ID.
239
+
240
+
3. Build and deploy the function:
241
+
242
+
```bash
243
+
pnpm build
244
+
pnpm push
245
+
```
246
+
247
+
4. In the Gram dashboard, go to **Toolsets**, click on the **Taskmaster** toolset, click **+ Add Tools**, select the newly created function, and save the changes.
248
+
249
+

250
+
251
+
5. Update the environment variables by going to the **Auth** tab, updating the newly added `RESEND_API_KEY` variable with your Resend API key, and saving the environment.
252
+
253
+

254
+
255
+
Now the MCP server includes both the auto-generated CRUD tools from your OpenAPI document and a custom function for sending task reminders.
256
+
257
+
You can test the tool in the Playground with the following prompt:
258
+
259
+
```
260
+
Please send an email to [email protected] to remind them of the pending tasks.
261
+
```
262
+
263
+

264
+
265
+
You can find the complete code for this Resend integration example in the [Gram repository](https://github.com/speakeasy-api/gram/tree/main/examples/resend).
266
+
170
267
## Testing the MCP server
171
268
172
269
Before connecting to external clients, test your setup by using the **Gram Playground** to verify that your tools are working correctly.
@@ -181,7 +278,7 @@ Before connecting to external clients, test your setup by using the **Gram Playg
181
278
Your Taskmaster MCP server is now ready to use with any MCP client. You can connect it to:
0 commit comments