Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rill-openrtb-prog-ads-mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store

# Rill
.env
tmp
.rillcloud
32 changes: 32 additions & 0 deletions rill-openrtb-prog-ads-mcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# OpenRTB Programmatic Advertising with External MCP Servers

This is the [OpenRTB example](../rill-openrtb-prog-ads) with external MCP servers connected to Rill's AI assistant, so it can combine the bid stream data with Linear, Notion, Atlassian, GitHub, Hugging Face and Slack.

The servers are declared in `connectors/`. See [External MCP Servers](https://docs.rilldata.com/guide/ai/external-mcp) for the connector reference.

## Set up

Deploy the project to Rill Cloud:

```
git clone https://github.com/rilldata/rill-examples.git
cd rill-examples/rill-openrtb-prog-ads-mcp
rill deploy
```

- **Linear, Notion, Atlassian, Hugging Face** use per-user OAuth, which is available in Rill Cloud only. Each user clicks **Connect** in the chat's **External tools** menu.
- **GitHub** uses a personal access token. Set it before chatting:
```
rill env set GITHUB_PAT <token>
```
- **Slack** uses per-user OAuth with a Slack app you create, because Slack doesn't support dynamic client registration:
1. Create an app at [api.slack.com/apps](https://api.slack.com/apps) and keep it internal to your workspace. Slack only allows internal and Marketplace apps to use its MCP server.
2. Under **OAuth & Permissions**, add the redirect URL `https://admin.rilldata.com/connectors/oauth/callback` and the user token scopes listed in `oauth_scopes` in `connectors/slack.yaml`.
3. Under **Agents & AI Apps**, enable MCP access.
4. Set the app's credentials from **Basic Information**:
```
rill env set SLACK_MCP_CLIENT_ID <client id>
rill env set SLACK_MCP_CLIENT_SECRET <client secret>
```

The Linear and Notion connectors expose only a subset of their tools through `security.include`, which keeps the assistant under the limit of 128 tools per request.
22 changes: 22 additions & 0 deletions rill-openrtb-prog-ads-mcp/alerts/alert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Alert YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/alerts

type: alert
display_name: Project Resource Status Check

# Check the alert every hour.
refresh:
cron: 0 * * * *

data:
resource_status:
where_error: true

# Send notifications in Slack.
notify:
slack:
channels:
- '#rill-alerts'
email:
recipients:
- admin_team@domain.com
8 changes: 8 additions & 0 deletions rill-openrtb-prog-ads-mcp/apis/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# API YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/apis
# Test your API endpoint at http://localhost:9009/v1/instances/default/api/api

type: api

metrics_sql: |
select requests, app_site_name from auction_metrics limit 10
8 changes: 8 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/atlassian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: connector
driver: mcp
url: https://mcp.atlassian.com/v1/mcp
display_name: Atlassian
ai_instructions: >
Use Atlassian to look up Jira issues and Confluence pages.
Never create or update anything unless the user explicitly asks.
auth: oauth
4 changes: 4 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/duckdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: connector
driver: duckdb

managed: true
10 changes: 10 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/github.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: connector
driver: mcp
url: https://api.githubcopilot.com/mcp/
display_name: GitHub
ai_instructions: >
Use GitHub to look up repositories, issues and pull requests.
Never create or modify anything unless the user explicitly asks.
headers:
Authorization: "Bearer {{ .env.GITHUB_PAT }}"
X-MCP-Toolsets: "repos,issues,pull_requests"
6 changes: 6 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/huggingface.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: connector
driver: mcp
url: https://huggingface.co/mcp
display_name: Hugging Face
ai_instructions: Use Hugging Face to search models, datasets and papers.
auth: oauth
35 changes: 35 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/linear.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
type: connector
driver: mcp
url: https://mcp.linear.app/mcp
display_name: Linear
ai_instructions: >
Use Linear to look up issues and projects.
Never create or update issues unless the user explicitly asks.
auth: oauth
security:
access: true
include:
- if: true
names:
- list_issues
- get_issue
- list_comments
- list_issue_statuses
- list_issue_labels
- list_projects
- get_project
- list_milestones
- get_milestone
- list_cycles
- list_initiatives
- get_initiative
- get_status_updates
- list_teams
- get_team
- list_users
- get_user
- list_documents
- get_document
- search_documentation
- save_issue
- save_comment
32 changes: 32 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/notion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
type: connector
driver: mcp
url: https://mcp.notion.com/mcp
display_name: Notion
ai_instructions: >
Use Notion to search and read pages and databases.
Never create or edit pages unless the user explicitly asks.
auth: oauth
security:
access: true
include:
- if: true
names:
- notion-search
- notion-fetch
- notion-query-data-sources
- notion-query-multiple-data-sources
- notion-query-meeting-notes
- notion-list-recent-pages
- notion-list-shared-pages
- notion-list-private-pages
- notion-list-favorite-pages
- notion-list-page-backlinks
- notion-get-comments
- notion-get-users
- notion-get-teams
- notion-get-self
- notion-check-mcp-next-steps
- notion-show-advanced-analysis-next-steps
- notion-create-pages
- notion-update-page
- notion-create-comment
11 changes: 11 additions & 0 deletions rill-openrtb-prog-ads-mcp/connectors/slack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: connector
driver: mcp
url: https://mcp.slack.com/mcp
display_name: Slack
ai_instructions: >
Use Slack to search messages and read channels.
Never post messages unless the user explicitly asks.
auth: oauth
oauth_client_id: "{{ .env.SLACK_MCP_CLIENT_ID }}"
oauth_client_secret: "{{ .env.SLACK_MCP_CLIENT_SECRET }}"
oauth_scopes: [search:read.public, search:read.users, channels:read, channels:history, users:read, users:read.email]
51 changes: 51 additions & 0 deletions rill-openrtb-prog-ads-mcp/dashboards/auction_explore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Explore YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/explores

type: explore

tags:
- dashboard
- explore
- auction
- programmatic_ads

display_name: "Programmatic Ads Auction"
metrics_view: auction_metrics

dimensions: '*'
measures: '*'

time_zones:
- America/Los_Angeles
- America/Chicago
- America/New_York
- Europe/London
- Europe/Paris

embeds:
hide_pivot: true
defaults:
measures:
- requests
- avg_bid_floor
- 1d_qps
dimensions:
- app_site_name
- app_site_domain
- pub_name
- app_site_cat
- ad_size
- device_state
- device_osv
- bid_floor_bucket
- platform_browser
- device_os
- device_type
- ad_position
- video_max_duration_bucket
- video_min_duration_bucket
- placement_type
- auction_type
- app_or_site
- device_country
time_range: P7D
70 changes: 70 additions & 0 deletions rill-openrtb-prog-ads-mcp/dashboards/bids_explore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Explore YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/explores

type: explore

tags:
- dashboard
- explore
- bids
- programmatic_ads

display_name: "Programmatic Ads Bids"
metrics_view: bids_metrics

dimensions: '*'
measures: '*'

#default:
# time_range: "PT24H"

time_zones:
- America/Los_Angeles
- America/Chicago
- America/New_York
- Europe/London
- Europe/Paris
- Asia/Jerusalem
- Europe/Moscow
- Asia/Kolkata
- Asia/Shanghai
- Asia/Tokyo
- Australia/Sydney
defaults:
measures:
- overall_spend
- total_bids
- impressions
- win_rate
- clicks
- ctr
- video_starts
- video_completes
- video_completion_rate
- avg_bid_price
- ecpm
- avg_bid_floor
dimensions:
- adomain
- advertiser_name
- app_or_site
- sites_domain
- app_site_name
- auction_type
- bid_floor_bucket
- campaign_name
- creative_type
- device_os
- device_osv
- device_region
- device_type
- interstitial
- line_item_name
- placement_type
- platform_browser
- player_size
- privacy
- pub_name
- sdk
- video_activity
time_range: P7D
Loading