LLM Agent Integration (MCP)
aidf is an executable for using AI Data Foundry from a terminal and from LLM agents. Run as aidf mcp, it becomes a server that exposes document analysis and workflow features as MCP (Model Context Protocol) tools. Once registered in an LLM client such as Claude Code, Claude Desktop, Cursor, or Codex CLI, you can upload local document files to a project and receive analysis results directly in the conversation.
An LLM agent performs the installation and client registration for you. The only step you do yourself is to run aidf login once in a terminal to store your API key. The same executable also works as a command-line tool in terminals and scripts.
This document covers calling AI Data Foundry from an LLM client. For the opposite direction, pulling files from an external MCP server into a project, see MCP Ingestion.
Prerequisites
- An API key must be issued. Create one under User Menu > API Keys. See Authentication for the full procedure.
- The API key user must have admin permission on the target project.
- The target project must have an active workflow configured. Without one, execution returns an error, so create it first by following Creating a Workflow.
- Installation is performed from a coding agent that can run shell commands (Claude Code, Cursor Agent, Codex CLI, etc.). To use a client without shell access (for example, Claude Desktop without tools connected), install from a coding agent and ask it to register the server in that client.
- You need a terminal to enter your API key. You type the key at the
aidf loginprompt in the terminal, not in the conversation with the agent.
Supported platforms are macOS (Apple Silicon and Intel), Linux (x86_64 and arm64), and Windows (x64 and ARM64). It is a single executable with no runtime dependencies.
Installation
Enter the following sentence in your coding agent as is.
Read http://sveltekit-prerender/static/mcp/install.md and proceed with the installationThe agent reads the installation instructions and performs the following steps in order.
- Detects the OS and architecture, downloads the matching executable, and verifies its checksum.
- Installs the
aidfexecutable and adds it to your PATH. (~/.local/binon macOS/Linux,%LOCALAPPDATA%\Programs\aidfon Windows) - Asks you to run
aidf loginin a terminal. You do this step yourself. See Log in below. - Confirms which MCP client to register with, then adds
aidf mcpto that client's configuration. - Calls the
list_projectstool to verify that your projects are listed, and reports a summary of the result.
The agent never takes the API key through the conversation or a command argument. You type the key directly at the login prompt in your terminal.
Issuing the key before you start lets the installation proceed without interruption.
Log in
After the installation, run the following commands in your own terminal.
aidf login # type your API key at the prompt (input is hidden)
aidf projects # list the projects you can access
aidf config set project <id> # if you have several projects, save the default (publicId)aidf login stores the key in the OS key store (macOS Keychain, Windows Credential Manager, or Linux Secret Service). On systems without a key store, such as headless Linux, it stores the key in a file that only you can read (permission 0600). Terminal commands and the MCP server share this key, so you log in only once.
If you use a deployment other than the production server (staging or on-premises), set the server address with aidf config set base_url https://<server address> before you log in.
Registration Example
The configuration that the agent creates looks like the following. Use it as a reference when registering manually or moving the server to another MCP client. <AIDF> is the absolute path of the installed aidf executable. The configuration contains no API key.
{
"mcpServers": {
"aidf": {
"command": "<AIDF>",
"args": ["mcp"]
}
}
}To find the absolute path, run realpath "$(command -v aidf)" on macOS/Linux or (Get-Command aidf).Source in Windows PowerShell. GUI clients such as Claude Desktop do not inherit the shell's PATH and do not expand ~, so always use the absolute path. On Windows, write each backslash twice inside JSON ("C:\\Users\\<user>\\AppData\\Local\\Programs\\aidf\\aidf.exe").
The registration method for each client is as follows.
| Client | Registration |
|---|---|
| Claude Code | claude mcp add aidf --scope user -- <AIDF> mcp command, or .mcp.json |
| Claude Desktop | Merge the JSON above into macOS ~/Library/Application Support/Claude/claude_desktop_config.json or Windows %APPDATA%\Claude\claude_desktop_config.json, then quit the app completely and start it again |
| Cursor | Merge the JSON above into ~/.cursor/mcp.json |
| Codex CLI | codex mcp add aidf -- <AIDF> mcp command, or add a [mcp_servers.aidf] entry (command = "<AIDF>", args = ["mcp"]) to ~/.codex/config.toml |
Settings
The key, server address, and default project come from the values stored with aidf login and aidf config set. The environment variables below take precedence over the stored values.
| Environment Variable | Overrides | Description |
|---|---|---|
AIDF_API_KEY |
The key stored with aidf login |
API key. Set it only where aidf login is not available, such as CI or a secret manager that injects the key. |
AIDF_DEFAULT_PROJECT_ID |
aidf config set project |
The project ID (publicId) to use by default |
AIDF_BASE_URL |
aidf config set base_url |
The server address when you use a deployment other than the production server |
To apply an environment variable to the MCP client only, put it in env of the registration.
Usage
Once registered, the 31 tools of the aidf server are available. Describe the task in the conversation and the agent picks the right tool. The three most used tools are the following.
| Tool | Description |
|---|---|
list_projects |
Lists the projects (ID and name) that the API key user can access. |
parse_file |
Uploads a local file to a project, waits for the workflow to finish, and downloads the result files. Returns the path where the results were saved. |
check_result |
Checks whether a document whose result was not yet received has finished processing, and downloads the result once available. |
The other tools, grouped by purpose, are the following.
| Purpose | Tools |
|---|---|
| Documents and folders | list_documents, move_document, set_document_category, list_folders, create_folder, create_folder_path, move_folder, delete_folder, download_zip |
| Run control | run_documents, stop_all, resume_all, list_runs |
| Viewing and editing workflows | list_flows, get_active_flow, set_active_flow, describe_flow, list_stages, apply_flow_spec, create_flow_from_spec |
| Test runs and run history | test_run, test_run_status, stop_test_run, list_traces, get_trace, get_trace_nodes, list_node_outputs, download_node_output |
run_documentssends documents that are already uploaded to the workflow, up to 200 at a time. Use it when you have many documents.resume_allsends all unprocessed documents and turns on automatic execution.stop_allturns off automatic execution and stops queued and running documents.- By default,
apply_flow_speconly validates the spec and shows what would change, without saving. The agent saves after you confirm the changes. test_runtries a flow on a single file without affecting production documents or automatic execution. Test documents stay in the folder named "테스트" (Test) at the project root.
Request Example
Analyze ~/Documents/contract.pdf with AI Data Foundry and show me the resultWhen the agent calls parse_file, the upload, workflow execution, completion wait, and result download happen in one step. The contents of the result ZIP depend on the last component of the workflow. See Project Workflow Integration for details.
- Workflow runs and test runs consume credits, exactly as when running from the web interface.
- If processing does not finish within the default wait time (3 minutes), the document UUID is returned. You can fetch the result afterwards with
check_result. - If the workflow includes a review step, the result is not available until the review is completed. Finish the review in the web interface, then call
check_result. - Result files are stored in a temporary folder on your PC and deleted automatically after 24 hours, so move them elsewhere if you want to keep them.
Using It from a Terminal
The same aidf executable is also a command-line tool. You can analyze documents from a terminal or a script without an agent.
aidf parse contract.pdf --dest outThe results are saved under out/contract/. It uses the same key and settings as the MCP server. Run aidf help to see all commands.
Updating
On startup, aidf mcp checks whether a new version is available and, if so, includes a notice in the tool response. When the agent relays this notice, enter the same sentence you used for installation.
Read http://sveltekit-prerender/static/mcp/install.md and proceed with the installationThe agent finds the existing installation and replaces only the executable. Your stored key, the settings saved with aidf config set, and the client registration are kept, so you do not need to log in again. Restart the MCP client after the replacement to apply the new version.
To turn off the version check, add "AIDF_UPDATE_CHECK": "false" to env of the registration.
Moving from `adf-mcp`
If you previously installed adf-mcp, you receive an update notice. Enter the same sentence above, and the agent moves you over in the following order.
- Installs
aidfand asks you to runaidf loginin a terminal. The agent does not copy the API key from your old configuration file, so type it at the login prompt yourself. - If the old registration had a default project or a server address, moves them with
aidf config set. - Changes the old MCP registration to
aidf mcpand removes the API key left in the configuration. - Asks whether to delete the old executable, and deletes it only if you agree.
aidf reads only environment variables that start with AIDF_. If your shell or CI sets a variable with an old name such as ADF_API_KEY, rename it, for example to AIDF_API_KEY.
Security
The API key stored with aidf login is kept in the OS key store or in a file that only you can read (permission 0600). It is not written to the MCP configuration file. Because the key allows actions that require project admin permission, treat it like a password.
Security Guidelines
- Never paste the API key into the conversation with an agent or into a command argument. Type it only at the
aidf loginprompt - If you put
AIDF_API_KEYinenvof the registration, that configuration file (such as.mcp.json) stores the key in plain text. Never commit it to a code repository, and on macOS/Linux restrict it so only you can read it (chmod 600 <config file>) - On a shared PC, run
aidf logoutwhen you finish to delete the stored key - Delete keys you no longer use under User Menu > API Keys
Troubleshooting
| Symptom | Action |
|---|---|
| Download or checksum verification fails during installation | Check your network and proxy environment, then retry. If it keeps failing, contact us. |
| "Unidentified developer" warning on macOS | Remove the quarantine attribute from the aidf executable with xattr -d com.apple.quarantine <AIDF>. |
| The client cannot find the server | Make sure command in the configuration is the absolute path of aidf and args is ["mcp"]. The ~ notation is not expanded. |
| Tools do not appear, or the server exits right away | Run <AIDF> mcp </dev/null in a terminal (in PowerShell, $null | & "<AIDF>" mcp). If it ends with aidf: API 키가 없습니다 and exit code 3, no key is stored, so run aidf login. If it works in the terminal but a GUI client cannot read the key, add AIDF_API_KEY to env of the registration. |
list_projects returns an error |
Run aidf projects in a terminal and check whether the same error appears. Verify that the API key is valid and that it belongs to an admin of the target project. |
| "No active flow" error on execution | Occurs when the project has no active workflow. Create a workflow and set it as the active flow by following Creating a Workflow, then try again. |
See Also
- Authentication →: Issuing API keys and security guidelines.
- Project Workflow Integration →: The API used internally by the MCP server and the structure of the result ZIP.
- MCP Ingestion →: Pulling files from an external MCP server into a project.