# Icon sources are https: or data: URIs

**Tool icon sources should be https: or data: URIs; clients MUST reject unsafe schemes such as javascript:, file:, ftp: and ws:, so the tool shows without its icon.**

Check `spec-icon-scheme` · MCP specification 2026-07-28 · default severity: attention · rubric 2.1.0. Last verified against MCP specification 2026-07-28: Overview (JSON Schema usage, _meta, icons) on 2026-11-18.

## What fails

Icons with other schemes are rejected, so the tool shows without its icon. The same section asks consumers to ensure the URI is either HTTPS or data:.

## The rule

> Clients MUST reject icon URIs that use unsafe schemes and redirects, such as `javascript:`, `file:`, `ftp:`, `ws:`, or local app URI schemes.

Source: [MCP specification 2026-07-28: Overview (JSON Schema usage, _meta, icons)](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#icons)

## How to fix it

Serve the icon over https from the server's own origin, or inline it as a data: URI.

1. Serve icons over https, ideally from the server’s own origin.
2. Or inline small icons as data:image/svg+xml or data:image/png URIs.
3. Set mimeType and sizes so clients can pick the right one.

### TypeScript SDK

```ts
import { McpServer } from '@modelcontextprotocol/server';
import * as z from 'zod';

const server = new McpServer({ name: 'issues', version: '1.0.0' });

server.registerTool(
  'get_issue',
  {
    title: 'Get issue',
    description: 'Return one issue by ID. Use when the user names an issue.',
    inputSchema: z.strictObject({
      issue_id: z.string().describe('Issue ID, for example ISS-42'),
    }),
    annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
    icons: [{ src: 'https://example.com/icons/issue.svg', mimeType: 'image/svg+xml', sizes: ['any'] }],
  },
  async ({ issue_id }) => ({ content: [{ type: 'text', text: 'Done' }] }),
);
```

### Python SDK

```python
from typing import Annotated

from pydantic import Field
from mcp.server.mcpserver import MCPServer
from mcp.types import ToolAnnotations
from mcp.types import Icon

server = MCPServer("issues")

@server.tool(
    title="Get issue",
    annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, openWorldHint=False),
    icons=[Icon(src="https://example.com/icons/issue.svg", mimeType="image/svg+xml", sizes=["any"])],
)
def get_issue(
    issue_id: Annotated[str, Field(description="Issue ID, for example ISS-42")],
) -> str:
    """Return one issue by ID. Use when the user names an issue."""
    return "Done"
```

## Questions

### Can I use an http: icon?

Clients are asked to ensure icons are HTTPS or data:. Plain http: is likely to be blocked by the client’s content policy.

### Does a broken icon fail review?

No rule rejects a tool for its icon, but the tool appears without one and the finding signals a client-side rejection.

## Related checks

- [Tool fields have the types the schema defines](https://isokron.ai/mcp-check/checks/spec-field-types)
- [_meta keys follow the key-name grammar](https://isokron.ai/mcp-check/checks/spec-meta-key)
- [Every list entry is a tool object with a name](https://isokron.ai/mcp-check/checks/spec-tool-shape)
- [MCP specification 2026-07-28: tools/list rules](https://isokron.ai/mcp-check/checks/protocol)

Counts toward: MCP specification 2026-07-28.

Rubric: https://isokron.ai/mcp-check/rubric

Check your tool list: https://isokron.ai/mcp-check
