Skip to content

Agent Task: Dynamically Create MCP Server #61

Description

@TanGentleman

Goal: Given a path to a convex directory, create an MCP server in Python with well defined tools.

Create a Planning Task

  1. Add fetch action with source=filepath, method=convex_mcp_spec.
  2. Add Propose plan action with a system message and optional context_reformatter_fn (str->str).
  3. Add revise plan with max revisions

All action configuration should be allowed to be declared at runtime using a RunnableConfig

Define the new fetch method in the below clause:

case PlanActionType.FETCH:
    source = action_args['source']
    method = action_args['method']
    logging.info(f'Fetched data from {source}.')
    match method:
        case 'get_email_content':
            result_string = 'This is an example email. Assign a task to Himanshu to review the updated docs.'
        case _:
            result_string = f'TODO: Implement method: {method}.'
    return {'success': True, 'data': result_string, 'error': None}

Adjust the below fns:

  • Functions start_action, execute_action, handle_action_result in handle_action.py
  • Function handle_user_message in handle_user_input.py
  • Function set_propose_plan_args in action_utils.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions