Skip to main content
Glama
GwylimWilliams

mcp-filesearch

README.md
# mcp-base

The template every MCP server here is instantiated from: a stdio server with one `registerTools` seam, structured output, and annotation presets so a tool cannot be written without carrying its safety hints.

It is also the cheap place to retire SDK unknowns. The `get_datetime` example exists to exercise the SDK v2 surface end to end — handshake, annotations, structured output, schema rejection — so the servers that matter don't discover those on their own.

## Status

| Tag | What it is |
| --- | --- |
| `v0.1.0` (current) | Proving ground — scaffold, example tool, tool-level tests |
| `v0.2.0` | The backport — single subprocess seam, root/path validation, security test suite |

Still to land before `v0.1.0` is tagged: the 1MCP wiring proof, `scripts/instantiate.ts`, the SDK-drift test and dependabot. The design notes live in Trilium.

## Requirements

Node ≥ 22. CI runs 22 and 24; `.node-version` pins 24 for local mise users.

## Develop

```
npm ci
npm run build
npm test
```

`npm test` runs vitest against `src/` through the SDK's own client over an in-memory transport, so no build and no spawned process are involved. `npm run build` is only needed for the `bin` entry and for `npx` over GitHub.

## Instantiate

1. **Use this template** on GitHub — a fork would share history, which is not what you want.
2. Run the instantiation script. It substitutes `__name__` and reports every replacement point it could not infer; the substitution contract lives in `src/placeholders.ts`. Until the script lands, substitute those points by hand.
3. Delete the example: `src/tools/get-datetime.ts`, its line in `src/tools/index.ts`, and its tests in `test/`.

Then add the first real tool — see [AGENTS.md](AGENTS.md) for the checklist.

## Register with 1MCP

```json
"mcpbase": {
  "command": "npx",
  "args": ["-y", "github:GwylimWilliams/mcp-base"],
  "tags": ["test"]
}
```

The `prepare` script builds on install, which is what makes `npx -y github:…` work without a published package.

When a server takes scoped roots, they are passed as **CLI args after the repo** — never `cwd`, so the scoping holds whatever directory the gateway happens to run in.

## The rules

- [`CONVENTIONS.md`](CONVENTIONS.md) — the canonical rule list
- [`AGENTS.md`](AGENTS.md) — the same rules agent-facing, plus the per-tool checklist
- [`docs/adding-a-tool.md`](docs/adding-a-tool.md) — the worked walkthrough
- [`SECURITY.md`](SECURITY.md) — the security posture and how to report a problem

## License

MIT.

TDQS

A3.7/5.0

Scored across 1 tool

Disambiguation5/5

The server exposes only one tool, so there is no possibility of confusing it with another tool. Its purpose is clearly stated as retrieving current date and time.

Naming Consistency5/5

The single tool name get_datetime follows a clear snake_case verb_noun convention. There are no other names to conflict with or create inconsistency.

Tool Count1/5

The server is named mcp-filesearch, but it provides only a datetime tool, which is unrelated to file search. A single trivial tool is an extreme mismatch for the apparent file-search purpose.

Completeness1/5

For a file-search server, there are no tools for searching, reading, listing, or retrieving files. The surface is severely incomplete and cannot support the stated domain.