Skip to content

Commit 5c7c754

Browse files
authored
Merge pull request #16 from topcoder-platform/dev
PROD RELEASE
2 parents 54be69a + fb9b8a1 commit 5c7c754

39 files changed

+1665
-841
lines changed

.circleci/config.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
version: 2.1
2+
defaults: &defaults
3+
docker:
4+
- image: cimg/python:3.13.5-browsers
5+
install_dependency: &install_dependency
6+
name: Installation of build and deployment dependencies.
7+
command: |
8+
pip3 install awscli --upgrade
9+
install_deploysuite: &install_deploysuite
10+
name: Installation of install_deploysuite.
11+
command: |
12+
git clone --branch v1.4.17 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
13+
cp ./../buildscript/master_deploy.sh .
14+
cp ./../buildscript/buildenv.sh .
15+
cp ./../buildscript/awsconfiguration.sh .
16+
cp ./../buildscript/psvar-processor.sh .
17+
18+
restore_cache_settings_for_build: &restore_cache_settings_for_build
19+
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }}
20+
21+
save_cache_settings: &save_cache_settings
22+
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }}
23+
paths:
24+
- node_modules
25+
26+
27+
builddeploy_steps: &builddeploy_steps
28+
- checkout
29+
- setup_remote_docker
30+
- run: *install_dependency
31+
- run: *install_deploysuite
32+
- restore_cache: *restore_cache_settings_for_build
33+
- run:
34+
name: "Build docker image"
35+
command: |
36+
./build.sh
37+
- save_cache: *save_cache_settings
38+
- deploy:
39+
name: Running MasterScript.
40+
command: |
41+
./awsconfiguration.sh $DEPLOY_ENV
42+
source awsenvconf
43+
./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar
44+
source deployvar_env
45+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE
46+
jobs:
47+
# Build & Deploy against development backend
48+
"build-dev":
49+
!!merge <<: *defaults
50+
environment:
51+
DEPLOY_ENV: "DEV"
52+
LOGICAL_ENV: "dev"
53+
APPNAME: "tc-mcp"
54+
steps: *builddeploy_steps
55+
56+
"build-qa":
57+
!!merge <<: *defaults
58+
environment:
59+
DEPLOY_ENV: "QA"
60+
LOGICAL_ENV: "qa"
61+
APPNAME: "tc-mcp"
62+
steps: *builddeploy_steps
63+
64+
"build-prod":
65+
!!merge <<: *defaults
66+
environment:
67+
DEPLOY_ENV: "PROD"
68+
LOGICAL_ENV: "prod"
69+
APPNAME: "tc-mcp"
70+
steps: *builddeploy_steps
71+
72+
workflows:
73+
version: 2
74+
build:
75+
jobs:
76+
# Development builds are executed on "develop" branch only.
77+
- "build-dev":
78+
context: org-global
79+
filters:
80+
branches:
81+
only:
82+
- dev
83+
84+
- "build-qa":
85+
context: org-global
86+
filters:
87+
branches:
88+
only:
89+
- qa
90+
91+
- "build-prod":
92+
context: org-global
93+
filters:
94+
branches:
95+
only: master

.github/workflows/tc_agent.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: TC Action Agent - Do It
2+
3+
on: issue_comment
4+
5+
jobs:
6+
pr_commented:
7+
# This job only runs for pull request comments
8+
name: '[PR Comment] - Use TC AI Agent'
9+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- run: |
13+
echo A comment on PR $NUMBER
14+
env:
15+
NUMBER: ${{ github.event.issue.number }}
16+
17+
tc_agent_tagged_in_issue_comment:
18+
# This job only runs for issue comments where the agent is tagged with @tc-ai
19+
name: '[Issue Comment] - Use TC AI Agent'
20+
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Call TC AI Agent
24+
uses: topcoder-platform/tc-action-agent@master

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
11
# Topcoder Model Context Protocol (MCP) Server
2+
3+
## Authentication Based Access via Guards
4+
5+
Tools/Resources/Prompts support authentication via TC JWT and/or M2M JWT. Providing JWT in the requests to the MCP server will result in specific listings and bahavior based on JWT access level/roles/permissions.
6+
7+
#### Using `authGuard` - requires TC jwt presence for access
8+
9+
```ts
10+
@Tool({
11+
name: 'query-tc-challenges-private',
12+
description:
13+
'Returns a list of Topcoder challenges based on the query parameters.',
14+
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
15+
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
16+
annotations: {
17+
title: 'Query Public Topcoder Challenges',
18+
readOnlyHint: true,
19+
},
20+
canActivate: authGuard,
21+
})
22+
```
23+
24+
#### Using `checkHasUserRole(Role.Admin)` - TC Role based guard
25+
26+
```ts
27+
@Tool({
28+
name: 'query-tc-challenges-protected',
29+
description:
30+
'Returns a list of Topcoder challenges based on the query parameters.',
31+
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
32+
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
33+
annotations: {
34+
title: 'Query Public Topcoder Challenges',
35+
readOnlyHint: true,
36+
},
37+
canActivate: checkHasUserRole(Role.Admin),
38+
})
39+
```
40+
41+
#### Using `canActivate: checkM2MScope(M2mScope.QueryPublicChallenges)` - M2M based access via scopes
42+
43+
```ts
44+
@Tool({
45+
name: 'query-tc-challenges-m2m',
46+
description:
47+
'Returns a list of Topcoder challenges based on the query parameters.',
48+
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
49+
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
50+
annotations: {
51+
title: 'Query Public Topcoder Challenges',
52+
readOnlyHint: true,
53+
},
54+
canActivate: checkM2MScope(M2mScope.QueryPublicChallenges),
55+
})
56+
```

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
set -eo pipefail
3-
docker buildx build --no-cache=true -t ${APPNAME}}:latest .
3+
docker buildx build --no-cache=true -t ${APPNAME}:latest .

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
"@nestjs/common": "^11.0.1",
2525
"@nestjs/core": "^11.0.1",
2626
"@nestjs/platform-express": "^11.0.1",
27-
"@rekog/mcp-nest": "^1.6.2",
27+
"@tc/mcp-nest": "topcoder-platform/MCP-Nest.git",
28+
"axios": "^1.10.0",
2829
"class-transformer": "^0.5.1",
2930
"class-validator": "^0.14.2",
3031
"dotenv": "^16.5.0",
3132
"json-stringify-safe": "^5.0.1",
3233
"jsonwebtoken": "^9.0.2",
3334
"jwks-rsa": "^3.2.0",
34-
"nanoid": "^5.1.5",
3535
"reflect-metadata": "^0.2.2",
3636
"rxjs": "^7.8.1",
3737
"zod": "^3.25.67"

0 commit comments

Comments
 (0)