film-mcp
# film mcp
A personal film and content search assistant. It uses the **search pages of sites you register**, lists results grouped by site, gives you the link, and can open it in your browser. It does not use an external search engine; it only looks at the sources you add.
It has two parts:
- **MCP server** (`film-mcp`) — add sources, search, and open results from a chat client such as Claude Desktop, Capy, or Cursor.
- **Web interface** (`film-mcp-web`) — a single-page panel that manages the same data (add sources, test them, search, and open results).
The default interface language is **English**. Turkish is also available; see [Language](#language).
---
## 1. Quick install
```bash
cd "/path/to/film mcp"
./install.sh
```
The installer creates a `.venv`, installs dependencies, and prepares two commands:
| Command | What it does |
| --- | --- |
| `.venv/bin/film-mcp` | MCP server (stdio). An MCP client runs this. |
| `.venv/bin/film-mcp-web` | Web interface at `http://127.0.0.1:8776/` (use `--port` if that port is taken) |
Web interface:
```bash
./start-web.sh # opens a browser automatically
./start-web.sh --no-open # start without opening a browser
./start-web.sh --language tr
```
Running the installer again is safe. If you only use the MCP side, you do not need to start the web interface; both share the same `data/sites.json` file.
---
## 2. Language
User-facing text (MCP tool descriptions and messages, web UI, and CLI help) is available in English and Turkish.
English is the default. To use Turkish, set one of these (first match wins):
| Variable | Example |
| --- | --- |
| `FILM_MCP_LANGUAGE` | `tr` or `en` (preferred) |
| `LANGUAGE` | `tr` or `tr_TR:en` |
| `LANG` | `tr_TR.UTF-8` |
You can also pass `--language tr` or `--language en` to `film-mcp` and `film-mcp-web`.
Examples:
```bash
FILM_MCP_LANGUAGE=tr ./start-web.sh
FILM_MCP_LANGUAGE=tr .venv/bin/film-mcp
```
In the web interface, use the **EN / TR** switch in the header. The choice is stored in the browser (`localStorage`). You can also open `http://127.0.0.1:8776/?lang=tr`.
For an MCP client, set the variable in the server config:
```json
{
"mcpServers": {
"film-arama": {
"command": "/PATH/TO/film-mcp/.venv/bin/film-mcp",
"env": {
"FILM_MCP_LANGUAGE": "tr"
}
}
}
}
```
A copy of this file is in `mcp-config.example.json`. Environment variable names only are documented in `.env.example`. Tool names (`site_ekle`, `film_ara`, and so on) stay the same in both languages so existing chats keep working.
A short Turkish README is in [README.tr.md](README.tr.md).
---
## 3. Adding it to an MCP client
You need the full path to the executable, for example:
```
/PATH/TO/film-mcp/.venv/bin/film-mcp
```
### Claude Desktop (Linux)
Add this to `~/.config/Claude/claude_desktop_config.json` (create the file if it does not exist):
```json
{
"mcpServers": {
"film-arama": {
"command": "/PATH/TO/film-mcp/.venv/bin/film-mcp",
"env": {
"FILM_MCP_LANGUAGE": "en"
}
}
}
}
```
Save the file, then fully quit and reopen Claude Desktop. You should see the "film-arama" tools in the chat.
(macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`; Windows: `%APPDATA%\Claude\claude_desktop_config.json`. Use the path to your own install folder.)
### Claude Code / terminal client
```bash
claude mcp add film-arama -- "/PATH/TO/film-mcp/.venv/bin/film-mcp"
```
### Cursor
`~/.cursor/mcp.json` (or `.cursor/mcp.json` inside a project):
```json
{
"mcpServers": {
"film-arama": {
"command": "/PATH/TO/film-mcp/.venv/bin/film-mcp",
"env": {
"FILM_MCP_LANGUAGE": "en"
}
}
}
}
```
### Clients that connect over HTTP
While the web interface is running, an MCP endpoint is also served on the same port: `http://127.0.0.1:8776/mcp` (Streamable HTTP). The **MCP setup** button in the web UI shows these blocks as ready-to-copy JSON.
> Note: the HTTP endpoint stops when the web interface stops. For a server that is always ready, use the `film-mcp` (stdio) command.
---
## 4. Web interface
- **Add a source:** a site name and URL are enough. The search URL is detected automatically; if it is not, enter it yourself under Advanced (`https://site.com/search?q={query}`).
- **Sources:** each entry has an on/off switch, rediscover (⟳), edit, and delete.
- **Search:** all sources are searched in parallel; results are grouped by site, with quality tags (1080p, 4K, and similar) parsed when present.
- **Open / Copy:** opens the result in your default browser or copies the link.
- **Presets:** JustWatch TR, TMDB, MyAnimeList, Beyazperde, and Filmweb can be added in one click.
- The theme button remembers light/dark mode; the `/` key focuses the search box.
- The **EN / TR** switch changes the interface language.
---
## 5. Chat commands
In an MCP client, you can say things like:
```
Save this site as FilmKey: https://filmkey.org
Search for the Matrix movie on my saved sites
Search for "Breaking Bad" only on DiziBox and FilmKey
Open result 3
Show the last search
Delete the FilmKey source
List my saved sites
```
### MCP tools
| Tool | What it does |
| --- | --- |
| `site_ekle(name, url, search_template?, notes?)` | Register a site and detect its search URL |
| `siteleri_listele(enabled_only?)` | List registered sources |
| `site_guncelle(site, name?, url?, search_template?, notes?, enabled?)` | Update a source |
| `site_sil(site)` | Delete a source |
| `site_test(site, query?)` | Verify a source with a trial search |
| `arama_adresi_bul(site)` | Rediscover the search template |
| `film_ara(query, sites?, limit_per_site?)` | Search all (or selected) sources |
| `son_aramayi_goster()` | Show numbered results from the last search |
| `link_ac(hedef)` | Open a result number or a URL in the browser |
| `sistem_durumu()` | Server status and data file path |
| `film://sites` (resource) | Source list as JSON |
---
## 6. How it works
1. **Schema detection:** search forms, hidden fields, and common search paths on the site home page are tried; the address that actually returns results is saved as `search_template`. POST forms are supported.
2. **Search:** all sources are queried at the same time (8 threads by default); each request has a 12-second timeout.
3. **Result extraction:** title, link, year, quality tags, and image; navigation and listing-page links are dropped, and results are ranked by relevance.
4. **JavaScript-heavy sites:** if the HTTP response is empty, the system Chrome/Chromium is started in headless mode and the DOM is read (`render_js`: automatic / always / never). No extra browser is downloaded.
5. **Opening:** the default browser is used via `xdg-open` (or `webbrowser`).
### Data
- `data/sites.json` — source definitions (single source of truth). This file is created at runtime and is not published with the repo. See `data/sites.example.json`.
- `data/last_search.json` — numbered results from the last search (used by "open result 3"). Also local-only.
- To use another directory, set `FILM_MCP_DATA=/path/to/folder`.
---
## 7. Troubleshooting
| Symptom | What to try |
| --- | --- |
| "The search URL could not be detected automatically" | Edit the source and enter the search URL yourself: search on the site in a browser, then replace the search term in the address bar with `{query}`. |
| "The page opened but no matching results could be extracted" | The site loads with JavaScript: edit the source and choose "Always render" (Chrome is required). |
| `HTTP 403` / `451` | The site uses bot protection (Cloudflare) or a regional block. "Always render" often helps; it cannot bypass a login wall. |
| "Could not reach the site" | The URL is wrong, or the site is behind a VPN. Test the address in a browser. |
| Browser does not open | `xdg-open` does not work from a session without a desktop; the link is still returned. |
| Port is in use | `./start-web.sh --port 8786` |
| Results look stale | Rediscover the search URL with the ⟳ button on the source card. |
---
## 8. Project layout
```
film mcp/
├── film_mcp/
│ ├── i18n.py # English / Turkish strings and language selection
│ ├── store.py # source store (JSON, atomic writes) + last-search history
│ ├── engine.py # schema detection, fetching, extraction, ranking
│ ├── server.py # FastMCP tools (stdio / streamable-http)
│ ├── web.py # FastAPI: /api/*, /mcp, UI
│ └── static/ # index.html, style.css, app.js
├── data/ # sites.json and last_search.json (created at runtime)
├── presets.json # suggested sources
├── tests/ # pytest tests
├── install.sh
└── start-web.sh
```
Tests:
```bash
./.venv/bin/python -m pytest tests -q
```
---
## License
MIT License. Copyright (c) 2026 Serdar Solak. See [LICENSE](LICENSE).
TDQS
Scored across 10 tools
Most tools have clearly distinct purposes: site CRUD, searching, reopening results, and opening links are easy to separate. The only mild overlap is between site_test (trial search for verification) and arama_adresi_bul (rediscover the search URL template), but the descriptions make the distinction reasonably clear.
All tool names use consistent snake_case and are in Turkish, which is readable and predictable. The convention is mostly object+verb (site_ekle, site_guncelle, film_ara, link_ac), with minor deviations like site_test and sistem_durumu using object+noun.
Ten tools is well-scoped for a film/site search MCP server. Each tool covers a distinct operation in the site-management and search workflow, and none feels redundant or excessive.
The surface covers full site lifecycle management (list, add, update, delete, test, rediscover search URL), film search, result replay, link opening, and status reporting. There are no obvious dead ends for the stated purpose.