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.0.tar.gz (21.5 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.0-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.0.tar.gz.

File metadata

File hashes

Hashes for mseep_ifly_spark_agent_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 469d8b385f2a732aed1d7a227e303fec5b604356f38c919a41e708cd87527786
MD5 c06692d17b816f132f2aa53c17ced103
BLAKE2b-256 20936523930e4c8054f84b44662426803f3eee7fbc2cdde3c86cdc83f77cd6b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mseep_ifly_spark_agent_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b852491e89d1161965b45e5ec2c9b1960a787b95acb716b9c86ea4366cc416
MD5 976a03c86b6259260a2ef4a81e8bbb3b
BLAKE2b-256 79e40ee4bb5a56728977939cbdfec9ac8d20745f2fe70ef75c92d1178f30d513

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