Skip to main content

This is a simple example of using MCP Server to invoke the task chain of the iFlytek SparkAgent Platform.

Project description

ifly-spark-agent-mcp

This is a simple example of using MCP Server to invoke the task chain of the iFlytek SparkAgent Platform.

Usage

Local debugging

Start the server using either stdio (default) or SSE transport:

# Using stdio transport (default)
uv run ifly-spark-agent-mcp

# Using SSE transport on custom port
uv run ifly-spark-agent-mcp --transport sse --port 8000

By default, the server exposes a tool named "upload_file" that accepts one required argument:

  • file: The path of the uploaded file

MCP Client Example

Using the MCP client, you can use the tool like this using the STDIO transport:

import asyncio
from mcp.client.session import ClientSession
from mcp.client.stdio import StdioServerParameters, stdio_client


async def main():
    async with stdio_client(
        StdioServerParameters(command="uv", args=["run", "ifly-spark-agent-mcp"])
    ) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()

            # List available tools
            tools = await session.list_tools()
            print(tools)

            # Call the upload_file tool
            result = await session.call_tool("upload_file", {"file": "/path/to/file"})
            print(result)


asyncio.run(main())

Usage with MCP client

Use on Claude

To add a persistent client, add the following to your claude_desktop_config.json or mcp.json file:

1. Use uv
{
  "mcpServers": {
    "ifly-spark-agent-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/ifly-spark-agent-mcp",
        "run",
        "ifly-spark-agent-mcp"
      ],
      "env": {
        "IFLY_SPARK_AGENT_BASE_URL": "xxxx",
        "IFLY_SPARK_AGENT_APP_ID": "xxxx",
        "IFLY_SPARK_AGENT_APP_SECRET": "xxxx"
      }
    }
  }
}
2. Use uvx with github repository
{
    "mcpServers": {
        "ifly-spark-agent-mcp": {
            "command": "uvx",
            "args": [
                "--from",
                "git+https://github.com/iflytek/ifly-spark-agent-mcp",
                "ifly-spark-agent-mcp"
            ],
            "env": {
              "IFLY_SPARK_AGENT_BASE_URL": "xxxx",
              "IFLY_SPARK_AGENT_APP_ID": "xxxx",
              "IFLY_SPARK_AGENT_APP_SECRET": "xxxx"
            }
        }
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mseep_ifly_spark_agent_mcp-0.1.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mseep_ifly_spark_agent_mcp-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file mseep_ifly_spark_agent_mcp-0.1.1.tar.gz.

File metadata

File hashes

Hashes for mseep_ifly_spark_agent_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fd9dd9f41d017ddb040bd7ed9b931d8828825cb7cfe1250795d1af2e838c02ca
MD5 3e755c271e3124fb3c85af8513b05981
BLAKE2b-256 6294669e1f3e34b806f91dc06bfd0d58a7811b16ece0abea7331818d8b66f2e1

See more details on using hashes here.

File details

Details for the file mseep_ifly_spark_agent_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_ifly_spark_agent_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bdc6e47d1727015e9fdfecc36b6fed0b91eaf8fa309a9e515f86bc113c80cf0
MD5 8372528c7b3ac4afc98ae8a5476e0e77
BLAKE2b-256 a65ccd06562e7bbf9809b23403992cb5b489997646333b56c9dcd1adf462615d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page