home / mcp / spark agent mcp server

Spark Agent MCP Server

Provides MCP-based access to the iFlytek SparkAgent task chain with file upload capability.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "funchs-ifly-spark-agent-mcp": {
      "command": "uv",
      "args": [
        "run",
        "ifly-spark-agent-mcp"
      ],
      "env": {
        "IFLY_SPARK_AGENT_APP_ID": "xxxx",
        "IFLY_SPARK_AGENT_BASE_URL": "xxxx",
        "IFLY_SPARK_AGENT_APP_SECRET": "xxxx"
      }
    }
  }
}

You can run and interact with the iFlytek SparkAgent MCP server to trigger its task chain from an MCP client. This server exposes a tool to upload files and can be controlled from a client to list available tools and execute actions, making it easy to automate file uploads and related tasks within your MCP workflow.

How to use

You will run the MCP server locally and connect to it with an MCP client over the stdio transport. The server provides a tool named upload_file which requires one argument called file that specifies the path of the file to be uploaded. To interact with the server from an MCP client, you can start the client session, list available tools, and call upload_file with the appropriate file path.

How to install

Prerequisites: you will need the MCP runtime available on your system in order to run the server with the stdio transport. The server is started via a command that invokes the MCP runner and points to the server module.

Step-by-step commands you can use to set up and run the server locally:

# Start the MCP server using the stdio transport (default)
uv run ifly-spark-agent-mcp

# Or start the MCP server with the stdio transport explicitly specified via a separate port (if your environment requires it)
uv run ifly-spark-agent-mcp --transport sse --port 8000

Additional details and usage notes

You can also interact with the server from an MCP client example. The client can initialize a session, list tools, and call the upload_file tool by passing a JSON payload with the file path you want to upload.

Usage with MCP client

To integrate into larger workflows, configure your MCP client to connect to the local server via the stdio transport command sequence shown above. From the client you can enumerate tools and execute upload_file when you need to upload a specific file.

Security and environment considerations

Set environment variables that control how the SparkAgent MCP server connects to its backend. The following environment variables are used by the server: IFLY_SPARK_AGENT_BASE_URL, IFLY_SPARK_AGENT_APP_ID, IFLY_SPARK_AGENT_APP_SECRET. Protect these values and avoid exposing them in client-side configurations. If you are running in a shared or CI environment, provide secure handling for these credentials.

Available tools

upload_file

Uploads a file by providing the path to the file via the file argument. This tool is available by default and is used to transfer files into the SparkAgent workflow.