"""MCP server for mineralfyi."""

from __future__ import annotations

from typing import Any

from mcp.server.fastmcp import FastMCP

from mineralfyi.api import MineralFYI

mcp = FastMCP("mineralfyi")


@mcp.tool()
def search_mineralfyi(query: str) -> dict[str, Any]:
    """Search mineralfyi.com for content matching the query."""
    with MineralFYI() as api:
        return api.search(query)
