> For the complete documentation index, see [llms.txt](https://docs.mozilla.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozilla.ai/mcpd/tutorial.md).

# Tutorial

This tutorial walks you through using `mcpd` from setup to making requests to a running MCP server.

{% hint style="info" %}
**What you need for this tutorial**

This tutorial adds the `time` server, which uses the `uvx` runtime. Install `uv` before starting. The API examples use `curl`. If you have `jq` installed, you can optionally append `| jq` to pretty-print the JSON responses.
{% endhint %}

***

## 1. Install `mcpd` via Homebrew

```bash
brew tap mozilla-ai/tap
brew install mcpd
```

{% hint style="success" %}
**Installation methods**

Please see our [Installation](/mcpd/installation.md) page for additional ways to install and run `mcpd`.
{% endhint %}

***

## 2. Initialize the Project

```bash
mcpd init
```

{% hint style="info" %}
**Config File Location**

This creates an `.mcpd.toml` file in your current directory.
{% endhint %}

***

## 3. Add an MCP Server

Add the latest version of the `time` server:

```bash
mcpd add time
```

You can also restrict access to allow only specific tools:

```bash
mcpd add time --tool get_current_time
```

{% hint style="success" %}
**Experiment with MCP servers**

You can quickly experiment with MCP servers before properly adding them to the `mcpd` configuration, by running the inspector tool:

```bash
mcpd inspector
```

This optional tool requires `npx`. For more information, please refer to the [official documentation](https://modelcontextprotocol.io/docs/tools/inspector) of the tool.
{% endhint %}

***

## 4. Set Startup Arguments

Configure any startup flags for the server, in this case `--local-timezone` is optional, but let's set it:

```bash
mcpd config args set time -- --local-timezone=Europe/London
```

***

## 5. Start the Daemon

Start `mcpd`, which launches MCP servers and exposes the HTTP API:

```bash
mcpd daemon
```

{% hint style="info" %}
**API Endpoint**

The API docs will be available at `http://localhost:8090/docs`
{% endhint %}

***

## 6. Query Running Servers

List all running servers:

```bash
curl -s http://localhost:8090/api/v1/servers
```

***

## 7. Call a Tool on a Server

Make a request to a tool on a specific MCP server:

```bash
curl -s -X POST -H "Content-Type: application/json" \
     -d '{"timezone": "America/New_York"}' \
     http://localhost:8090/api/v1/servers/time/tools/get_current_time
```

## 8. Use `mcpd` in your Agentic Python application

For [examples](https://github.com/mozilla-ai/mcpd-sdk-python/tree/main/examples/anyagent) on using `mcpd` with agents in Python, please refer to the [Python SDK](https://github.com/mozilla-ai/mcpd-sdk-python) documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mozilla.ai/mcpd/tutorial.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
