# MCP tools

The Tessl MCP (Model Context Protocol) server provides tools that AI coding agents can use to search for, install, and work with tiles from the Tessl registry.

## Server Configuration

The Tessl MCP server can be configured in your AI coding agent's MCP configuration or by running:

```sh
tessl init --agent <agent-name>
```

**Server Details:**

* **Command**: `tessl mcp start`
* **Type**: stdio
* **Name**: Tessl Registry MCP

## Available Tools

### login

Authenticate with Tessl to access registry features.

**Authentication**: Not required (this tool provides authentication)

**Parameters**

None

**Notes**

* Attempts to open authentication URL in your browser automatically
* Authentication happens asynchronously - credentials are saved in the background
* After completing authentication once, authenticated tools work automatically
* Triggers automatic dependency sync after successful login

***

### search

Search for tiles in the Tessl registry by name, package URL (PURL), or HTTP URL.

**Authentication**: Required (automatically handles authentication if needed)

**Parameters**

* `query` (string, required): Search query - can be a tile name, package URL, or HTTP URL

**Notes**

* Works with partial names and package URLs (PURLs)
* Supports HTTP URLs from package registries (e.g., npm, PyPI)
* Returns tile name, version, description, and installation command

**Example**

```json
{
  "query": "svelte"
}
```

***

### install

Install tiles into your project. Can install a specific tile or sync all missing tiles from tessl.json.

**Authentication**: Required (automatically handles authentication if needed)

**Parameters**

* `packageName` (string, optional): Tile name to install (e.g., "workspace/tile" or "workspace/tile\@version"). If not provided, installs all missing tiles from tessl.json
* `projectDir` (string, optional): Project directory. Defaults to current working directory

**Notes**

* Tiles are installed to `.tessl/tiles/<workspace>/<tile>/` in your project
* Your project's `tessl.json` is automatically updated with the tile reference
* If a tile is already installed and up-to-date, it will be skipped
* If no version is specified, installs the latest version

**Example: Install specific tile**

```json
{
  "packageName": "tessl/svelte@5.38.0"
}
```

**Example: Sync all missing tiles**

```json
{}
```

***

### uninstall

Uninstall a tile from your project.

**Authentication**: Not required

**Parameters**

* `packageName` (string, required): Tile name to uninstall (e.g., "workspace/tile")

**Notes**

* Removes the tile from `tessl.json` and deletes files from `.tessl/tiles/`
* Does not require authentication (local operation only)
* Only affects your local project - doesn't unpublish from the registry

**Example**

```json
{
  "packageName": "tessl/svelte"
}
```

***

### query\_library\_docs

Gather relevant documentation context from installed tiles using AI-powered search.

**Authentication**: Required (automatically handles authentication if needed)

**Parameters**

* `query` (string, required): A question, task description, or topic about libraries/dependencies you need information about. Can be simple ("how to validate emails?") or detailed ("I need to implement user authentication with session management, what abstractions are available?"). Works best with targeted queries but supports open-ended questions.

**Notes**

* Requires tiles to be installed first (run `tessl install <workspace/tile>` or `tessl search`)
* Uses AI to identify relevant documentation files for your query
* Extracts and returns relevant content chunks from files
* Works best with focused, specific queries

**Example: Get relevant content**

```json
{
  "query": "How do I create a reactive store in Svelte?"
}
```

***

### status

Check authentication status and tile synchronization status for your project.

**Authentication**: Not required

**Parameters**

None

**Notes**

* Returns JSON with authentication status and tile sync summary
* Shows tiles that are up-to-date, missing, outdated, or invalid
* Useful for checking if you need to run `tessl install` to sync tiles

**Example**

```json
{                                                                     
       "authentication": {
         "authenticated": true,
         "email": "example@tessl.io"
       },
       "manifest": {
         "summary": {
           "upToDate": 1,
           "missing": 0,
           "outdated": 0,
           "invalid": 0
         },
         "tiles": {
           "upToDate": [
             {
               "workspaceName": "tessl",
               "tileName": "pypi-fastapi",
               "manifestVersion": "0.116.0",
               "installedVersion": "0.116.0"
             }
           ],
           "missing": [],
           "outdated": [],
           "invalidPackages": []
         }
       }
     }

```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tessl.io/reference/mcp-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
