# Project export: PokeDash

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: Order DoorDash with Poke!
- Devpost: https://devpost.com/software/pokedash
- GitHub: https://github.com/PenTest-duck/PokeDash
- Team: 0 GitHub contributor(s) — 

## Devpost submission (written by the team)

No Devpost description available.

## README (from the GitHub repository)

# MCP Server Template

A minimal [FastMCP](https://github.com/jlowin/fastmcp) server template for Render deployment with streamable HTTP transport.

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/InteractionCo/mcp-server-template)

## Local Development

### Setup

Fork the repo, then run:

```bash
git clone <your-repo-url>
cd mcp-server-template
conda create -n mcp-server python=3.13
conda activate mcp-server
pip install -r requirements.txt
```

### Test

```bash
python src/server.py
# then in another terminal run:
npx @modelcontextprotocol/inspector
```

Open http://localhost:3000 and connect to `http://localhost:8000/mcp` using "Streamable HTTP" transport (NOTE THE `/mcp`!).

## Deployment

### Option 1: One-Click Deploy
Click the "Deploy to Render" button above.

### Option 2: Manual Deployment
1. Fork this repository
2. Connect your GitHub account to Render
3. Create a new Web Service on Render
4. Connect your forked repository
5. Render will automatically detect the `render.yaml` configuration

Your server will be available at `https://your-service-name.onrender.com/mcp` (NOTE THE `/mcp`!)

## Poke Setup

You can connect your MCP server to Poke at (poke.com/settings/connections)[poke.com/settings/connections].
To test the connection explitly, ask poke somethink like `Tell the subagent to use the "{connection name}" integration's "{tool name}" tool`.
If you run into persistent issues of poke not calling the right MCP (e.g. after you've renamed the connection) you may send `clearhistory` to poke to delete all message history and start fresh.
We're working hard on improving the integration use of Poke :)


## Customization

Add more tools by decorating functions with `@mcp.tool`:

```python
@mcp.tool
def calculate(x: float, y: float, operation: str) -> float:
    """Perform basic arithmetic operations."""
    if operation == "add":
        return x + y
    elif operation == "multiply":
        return x * y
    # ...
```


## Detected evidence (automated analysis)

Indexed codebase: 4 recognized source files, 8 KB.
- Python (language) — detected in the code

## Codebase structure (from repository index)

### Files (6 of 6)

```
.gitignore
README.md
render.yaml
requirements.txt
src/app.py
src/server.py
```

### Dependencies

- requirements.txt: annotated-types@==0.7.0, anyio@==4.11.0, attrs@==25.4.0, Authlib@==1.6.5, beartype@==0.22.4, cachetools@==6.2.1, certifi@==2025.10.5, cffi@==2.0.0, charset-normalizer@==3.4.4, click@==8.3.0, cryptography@==46.0.3, cyclopts@==4.0.0, diskcache@==5.6.3, dnspython@==2.8.0, docstring_parser@==0.17.0, docutils@==0.22.2, dotenv@==0.9.9, email-validator@==2.3.0, exceptiongroup@==1.3.0, fastmcp@==2.13.0.1, h11@==0.16.0, httpcore@==1.0.9, httpx@==0.28.1, httpx-sse@==0.4.3, idna@==3.11, isodate@==0.7.2, jaraco.classes@==3.4.0, jaraco.context@==6.0.1, jaraco.functools@==4.3.0, jsonschema@==4.25.1, jsonschema-path@==0.3.4, jsonschema-specifications@==2025.9.1, keyring@==25.6.0, lazy-object-proxy@==1.12.0, markdown-it-py@==4.0.0, MarkupSafe@==3.0.3, mcp@==1.19.0, mdurl@==0.1.2, more-itertools@==10.8.0, openapi-core@==0.19.5, openapi-pydantic@==0.5.1, openapi-schema-validator@==0.6.3, openapi-spec-validator@==0.7.2, parse@==1.20.2, pathable@==0.4.4, pathvalidate@==3.3.1, platformdirs@==4.5.0, py-key-value-aio@==0.2.8, py-key-value-shared@==0.2.8, pycparser@==2.23, pydantic@==2.12.3, pydantic_core@==2.41.4, pydantic-settings@==2.11.0, Pygments@==2.19.2, PyJWT@==2.10.1, pyperclip@==1.11.0, python-dotenv@==1.2.1, python-multipart@==0.0.20, PyYAML@==6.0.3, referencing@==0.36.2, requests@==2.32.5, rfc3339-validator@==0.1.4, rich@==14.2.0, rich-rst@==1.3.2, rpds-py@==0.28.0, six@==1.17.0, sniffio@==1.3.1, sse-starlette@==3.0.2, starlette@==0.48.0, typing_extensions@==4.15.0, typing-inspection@==0.4.2, urllib3@==2.5.0, uvicorn@==0.38.0, websockets@==15.0.1, Werkzeug@==3.1.1

### Recent commits (newest first)

- pokedash
- [readme] add clearhistory docs
- [server] fix 400s, add prompt guidance
- [docs] highlight need for /mcp
- [Example Server] Initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### requirements.txt

```
annotated-types==0.7.0
anyio==4.11.0
attrs==25.4.0
Authlib==1.6.5
beartype==0.22.4
cachetools==6.2.1
certifi==2025.10.5
cffi==2.0.0
charset-normalizer==3.4.4
click==8.3.0
cryptography==46.0.3
cyclopts==4.0.0
diskcache==5.6.3
dnspython==2.8.0
docstring_parser==0.17.0
docutils==0.22.2
dotenv==0.9.9
email-validator==2.3.0
exceptiongroup==1.3.0
fastmcp==2.13.0.1
h11==0.16.0
httpcore==1.0.9
httpx==0.28.1
httpx-sse==0.4.3
idna==3.11
isodate==0.7.2
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.3.0
jsonschema==4.25.1
jsonschema-path==0.3.4
jsonschema-specifications==2025.9.1
keyring==25.6.0
lazy-object-proxy==1.12.0
markdown-it-py==4.0.0
MarkupSafe==3.0.3
mcp==1.19.0
mdurl==0.1.2
more-itertools==10.8.0
openapi-core==0.19.5
openapi-pydantic==0.5.1
openapi-schema-validator==0.6.3
openapi-spec-validator==0.7.2
parse==1.20.2
pathable==0.4.4
pathvalidate==3.3.1
platformdirs==4.5.0
py-key-value-aio==0.2.8
py-key-value-shared==0.2.8
pycparser==2.23
pydantic==2.12.3
pydantic-settings==2.11.0
pydantic_core==2.41.4
Pygments==2.19.2
PyJWT==2.10.1
pyperclip==1.11.0
python-dotenv==1.2.1
python-multipart==0.0.20
PyYAML==6.0.3
referencing==0.36.2
requests==2.32.5
rfc3339-validator==0.1.4
rich==14.2.0
rich-rst==1.3.2
rpds-py==0.28.0
six==1.17.0
sniffio==1.3.1
sse-starlette==3.0.2
starlette==0.48.0
typing-inspection==0.4.2
typing_extensions==4.15.0
urllib3==2.5.0
uvicorn==0.38.0
websockets==15.0.1
Werkzeug==3.1.1

```

### src/app.py

```python
import jwt
import time
import math
from dotenv import load_dotenv
import os
import random

load_dotenv()

token = jwt.encode(
    {
        "aud": "doordash",
        "iss": os.getenv("DOORDASH_DEVELOPER_ID"),
        "kid": os.getenv("DOORDASH_KEY_ID"),
        "exp": str(math.floor(time.time() + 300)),
        "iat": str(math.floor(time.time())),
    },
    jwt.utils.base64url_decode(os.getenv("DOORDASH_SIGNING_SECRET")),
    algorithm="HS256",
    headers={"dd-ver": "DD-JWT-V1"}
)
print(token)

import requests

endpoint = "https://openapi.doordash.com/drive/v2/deliveries/"

headers = {"Accept-Encoding": "application/json",
           "Authorization": "Bearer " + token,
           "Content-Type": "application/json"}

request_body = { # Modify pickup and drop off addresses below
    "external_delivery_id": f"D-{random.randint(1000, 9999)}",
    "pickup_address": "901 Market Street 6th Floor San Francisco, CA 94103",
    "pickup_business_name": "Wells Fargo SF Downtown",
    "pickup_phone_number": "+16505555555",
    "pickup_instructions": "Enter gate code 1234 on the callbox.",
    "dropoff_address": "901 Market Street 6th Floor San Francisco, CA 94103",
    "dropoff_business_name": "Wells Fargo SF Downtown",
    "dropoff_phone_number": "+16505555555",
    "dropoff_instructions": "Enter gate code 1234 on the callbox.",
    "order_value": 1999
}

create_delivery = requests.post(endpoint, headers=headers, json=request_body) # Create POST request


print(create_delivery.status_code)
print(create_delivery.text)
print(create_delivery.reason)
```

### src/server.py

```python
#!/usr/bin/env python3
import os
import jwt
import time
import math
import random
import requests
from dotenv import load_dotenv
from fastmcp import FastMCP

load_dotenv()

mcp = FastMCP("DoorDash MCP Server")

def generate_doordash_token() -> str:
    """Generate JWT token for DoorDash API authentication."""
    token = jwt.encode(
        {
            "aud": "doordash",
            "iss": os.getenv("DOORDASH_DEVELOPER_ID"),
            "kid": os.getenv("DOORDASH_KEY_ID"),
            "exp": str(math.floor(time.time() + 300)),
            "iat": str(math.floor(time.time())),
        },
        jwt.utils.base64url_decode(os.getenv("DOORDASH_SIGNING_SECRET")),
        algorithm="HS256",
        headers={"dd-ver": "DD-JWT-V1"}
    )
    return token

@mcp.tool(description="Order a DoorDash delivery by providing pickup and dropoff information. Returns the delivery status and tracking information.")
def order_doordash(
    pickup_address: str,
    pickup_business_name: str,
    pickup_phone_number: str,
    dropoff_address: str,
    dropoff_business_name: str,
    dropoff_phone_number: str,
    order_value: int,
    pickup_instructions: str = "",
    dropoff_instructions: str = ""
) -> dict:
    """
    Create a DoorDash delivery order.
    
    Args:
        pickup_address: Full address for pickup location (e.g., "901 Market Street 6th Floor San Francisco, CA 94103")
        pickup_business_name: Name of the business or location for pickup
        pickup_phone_number: Phone number for pickup contact (format: +1XXXXXXXXXX)
        dropoff_address: Full address for dropoff location
        dropoff_business_name: Name of the business or location for dropoff
        dropoff_phone_number: Phone number for dropoff contact (format: +1XXXXXXXXXX)
        order_value: Value of the order in cents (e.g., 1999 for $19.99)
        pickup_instructions: Optional special instructions for pickup (e.g., gate codes, suite numbers)
        dropoff_instructions: Optional special instructions for dropoff (e.g., gate codes, suite numbers)
    
    Returns:
        dict: Delivery status, tracking information, and API response details
    """
    try:
        # Generate authentication token
        token = generate_doordash_token()
        
        # Prepare API request
        endpoint = "https://openapi.doordash.com/drive/v2/deliveries/"
        headers = {
            "Accept-Encoding": "application/json",
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json"
        }
        
        # Generate unique delivery ID
        external_delivery_id = f"D-{random.randint(1000, 9999)}"
        
        # Prepare request body
        request_body = {
            "external_delivery_id": external_delivery_id,
            "pickup_address": pickup_address,
            "pickup_business_name": pickup_business_name,
            "pickup_phone_number": pickup_phone_number,
            "pickup_instructions": pickup_instructions,
            "dropoff_address": dropoff_address,
            "dropoff_business_name": dropoff_business_name,
            "dropoff_phone_number": dropoff_phone_number,
            "dropoff_instructions": dropoff_instructions,
            "order_value": order_value
        }
        
        # Make API request
        response = requests.post(endpoint, headers=headers, json=request_body)
        
        # Prepare result
        result = {
            "success": response.status_code in [200, 201],
            "status_code": response.status_code,
            "external_delivery_id": external_delivery_id,
            "response": response.json() if response.status_code in [200, 201] else response.text,
            "reason": response.reason
        }
        
        return result
        
    except Exception as e:
        return {
            "success": False,
            "error": str(e),
            "message": "Failed to create DoorDash delivery order"
        }

@mcp.tool(description="Get information about the MCP server including name, version, environment, and Python version")
def get_server_info() -> dict:
    return {
        "server_name": "DoorDash MCP Server",
        "version": "1.0.0",
        "environment": os.environ.get("ENVIRONMENT", "development"),
        "python_version": os.sys.version.split()[0]
    }

if __name__ == "__main__":
    port = int(os.environ.get("PORT", 8000))
    host = "0.0.0.0"
    
    print(f"Starting FastMCP server on {host}:{port}")
    
    mcp.run(
        transport="http",
        host=host,
        port=port,
        stateless_http=True
    )

```

### render.yaml

```yaml
services:
  - type: web
    name: PokeDash
    runtime: python
    buildCommand: pip install -r requirements.txt
    startCommand: python src/server.py
    plan: free
    autoDeploy: false
    envVars:
      - key: ENVIRONMENT
        value: production

```