MCP tools reference
The@withfoundry/mcp-server exposes these tools to Cursor (and other MCP clients). All calls use your configured FOUNDRY_API_KEY and the API base URL https://api.withfoundry.ai.
Memory tools
foundry_memory_write
Write one or more entries into a namespace.| Parameter | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Namespace (e.g. app or user id). |
entries | array | Yes | Items with content and optional metadata. |
entries[].content | string | Yes | Text to store. |
entries[].metadata | object | No | JSON for filtering/display. |
{ ids: string[] } — created entry ids.
Example (as used by Cursor):“Write to Foundry memory, namespace
my-app: ‘We use API keys with prefix key_ in the Authorization header.’”
foundry_memory_search
Semantic search over a namespace.| Parameter | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Namespace to search. |
query | string | Yes | Natural-language query. |
limit | number | No | Max results (e.g. 5–20). |
metadataFilter | object | No | Key-value filters on metadata. |
{ id, content, metadata, score? }.
Example:“Search Foundry memory in
my-app for ‘how do we authenticate?’”
foundry_memory_get_context
Get a single context string from semantic search for use in prompts.| Parameter | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Namespace to search. |
query | string | Yes | Query for ranking. |
limit | number | No | Max entries in the context string. |
{ text: string, entryIds: string[] }.
Example:“Get Foundry context for namespace
my-app with query ‘user preferences and auth’, limit 3.”
Security tools
foundry_security_scan_repo
Start a security scan for a repository.| Parameter | Type | Required | Description |
|---|---|---|---|
repoUrl | string | Yes | Clone URL (e.g. https://github.com/org/repo). |
branch | string | No | Branch/ref to scan. |
waitForCompletion | boolean | No | If true, wait and return findings. |
- Without wait:
{ scanId, status }. - With wait:
{ scanId, status, findings }.
“Run a Foundry security scan on this repo” (Cursor may infer repo from workspace.)
foundry_security_get_scan_result
Get status and findings for a scan.| Parameter | Type | Required | Description |
|---|---|---|---|
scanId | string | Yes | Id from foundry_security_scan_repo. |
{ scanId, status, findings?, error? }.
Example:“Get Foundry scan result for scan_abc123.”
Envelope and errors
The MCP server calls the REST API. API responses use the envelope:data (or a translated message) so Cursor can show or act on it.
Namespace tips in Cursor
- Use a stable namespace per project or user (e.g.
my-app,cursor-user-123). - Ask the AI to “search Foundry memory in namespace X for Y” so it uses the right namespace and query.