> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mira-app.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding an SSE MCP Server

> Connect a remote HTTP-based MCP server to MIRA using Server-Sent Events.

A **Server-Sent Events (SSE)** MCP server runs as an HTTP service — either on your local machine or hosted remotely. MIRA connects to it via a URL, making SSE servers ideal for shared team tooling and hosted APIs.

## Prerequisites

* The SSE server must be reachable from your machine (local port or public URL).
* The server must implement the MCP SSE transport spec: `GET /sse` to open the event stream, `POST /message` to receive requests.

## Add the server in MIRA

<Steps>
  <Step title="Open Settings">
    Press ⌘, and navigate to **MCP Tools**.
  </Step>

  <Step title="Click Add Server">
    Click the **+ Add Server** button.
  </Step>

  <Step title="Select transport">
    Choose **SSE** from the Transport dropdown.
  </Step>

  <Step title="Enter the server URL">
    Type the base URL of the MCP server (without `/sse`).

    Examples:

    | Environment      | URL                                |
    | ---------------- | ---------------------------------- |
    | Local dev server | `http://localhost:3001`            |
    | Docker container | `http://host.docker.internal:3001` |
    | Remote server    | `https://mcp.mycompany.com`        |
  </Step>

  <Step title="Add HTTP headers (optional)">
    Click **Add Header** to inject authentication or custom headers.

    ```
    Authorization: Bearer your-api-key
    ```

    <Warning>
      Header values are stored in the OS keychain. They are never logged or included in exports.
    </Warning>
  </Step>

  <Step title="Give the server a name">
    Enter a short name (e.g. `company-tools`). This becomes the tool namespace prefix.
  </Step>

  <Step title="Set scope">
    Choose **Session** or **Global**. See [Session vs Global](./session-vs-global).
  </Step>

  <Step title="Save and connect">
    Click **Save**. MIRA opens the SSE stream and calls `list_tools`. Discovered tools appear
    in the server card.
  </Step>
</Steps>

## Connection status

| Status        | Meaning                             |
| ------------- | ----------------------------------- |
| 🟢 Connected  | SSE stream open; tools discovered   |
| 🟡 Connecting | Waiting for the server to respond   |
| 🔴 Error      | Connection failed; hover for detail |

## Security considerations

* Use **HTTPS** for any remote SSE server to protect tool arguments and results in transit.
* MIRA does not validate the server's TLS certificate for self-signed certificates on localhost (`http://localhost:*`). For all other hosts, a valid certificate is required.
* API keys in the Authorization header are stored in the OS keychain, not in the MIRA database.

## Troubleshooting

| Symptom                   | Fix                                                                         |
| ------------------------- | --------------------------------------------------------------------------- |
| Error: `ECONNREFUSED`     | Server is not running on the specified port                                 |
| Error: `401 Unauthorized` | Check that the Authorization header value is correct                        |
| Tools list is empty       | Ensure the server returns a valid `list_tools` response                     |
| Stream drops after 30 s   | Add keep-alive pings to the server; MIRA reconnects automatically after 5 s |

<Note>Edit this page — [Open a pull request](https://github.com/satyendra2013/mira-app/edit/main/docs/features/mcp-tools/adding-sse-server.mdx)</Note>
