Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
91fa77f
Circle Ci changes integration
Gunasekar-K Jun 30, 2025
1d3ec10
Merge pull request #1 from topcoder-platform/master
kkartunov Jun 30, 2025
a0ee9b3
Add global API prefix
kkartunov Jun 30, 2025
9d50392
auth setup
kkartunov Jul 1, 2025
31b5591
form mcp-nest
kkartunov Jul 1, 2025
5f404f0
Use canActivate for tools
vas3a Jul 3, 2025
a2f1683
rename method & add doc comments
vas3a Jul 4, 2025
b5dfd8e
Merge pull request #2 from topcoder-platform/PM-1437_use-canActivate
kkartunov Jul 10, 2025
cd5f685
Merge pull request #4 from topcoder-platform/feat/auth
kkartunov Jul 10, 2025
7c26fea
update pnpm-lock
vas3a Jul 10, 2025
ac1ca38
Merge pull request #5 from topcoder-platform/PM-1437_use-canActivate
vas3a Jul 10, 2025
80f51ae
adds tc-agent
kkartunov Jul 10, 2025
1471192
fix uses
kkartunov Jul 10, 2025
a52569a
trigger type
kkartunov Jul 10, 2025
d7bbbb8
simple trigger on comments
kkartunov Jul 10, 2025
72753c7
Merge pull request #8 from topcoder-platform/feat/tc-agent
kkartunov Jul 10, 2025
32faaea
call Neo
kkartunov Jul 10, 2025
f802d41
logger level
vas3a Jul 10, 2025
d3d7f42
Merge pull request #9 from topcoder-platform/logger-level-for-challenges
vas3a Jul 10, 2025
298e0b5
test log
vas3a Jul 10, 2025
d9ecc69
Merge pull request #10 from topcoder-platform/logger-level-for-challe…
vas3a Jul 10, 2025
8491fea
more logs
vas3a Jul 10, 2025
54d9aca
Merge pull request #11 from topcoder-platform/logger-level-for-challe…
vas3a Jul 10, 2025
ba7e6ee
Use axios for fetching challenges
vas3a Jul 10, 2025
3a68cfd
Merge pull request #12 from topcoder-platform/logger-level-for-challe…
vas3a Jul 10, 2025
88d24a3
package updated - add axios
vas3a Jul 10, 2025
a0f137c
Merge pull request #13 from topcoder-platform/logger-level-for-challe…
vas3a Jul 10, 2025
088c749
Add swagger API docs as resources
kkartunov Jul 16, 2025
10ddf0f
add skills tool & clean up
kkartunov Jul 16, 2025
a6b3884
fix challenges v6 swagger url
kkartunov Jul 16, 2025
f69d9e5
support array in queries for challenegs
kkartunov Jul 16, 2025
b2e1b25
update ai agnet action
kkartunov Jul 16, 2025
77630ec
Fix schema issues for challenges query tool
kkartunov Jul 28, 2025
763d7df
make desc in category nullable
kkartunov Jul 28, 2025
99a1c19
fix skills sort order errors
kkartunov Jul 28, 2025
98cc27a
more output defs
kkartunov Aug 1, 2025
d4e5b06
fix current phase structure
kkartunov Aug 1, 2025
37466ca
add totalPrizesInCents
kkartunov Aug 4, 2025
3e873fd
fix: allow passing single tag in "tags" param
maxceem Aug 4, 2025
90946c5
Merge pull request #14 from maxceem/feature/fix-single-param-in-tags
kkartunov Aug 5, 2025
c74c69f
up to v6 fore review api
kkartunov Aug 18, 2025
6e610fb
switch to UUID
kkartunov Aug 21, 2025
67255d9
Add timing logging for every call on mcp
vas3a Aug 27, 2025
fb9b8a1
Merge pull request #15 from topcoder-platform/add-timing-logging
vas3a Aug 27, 2025
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
95 changes: 95 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
version: 2.1
defaults: &defaults
docker:
- image: cimg/python:3.13.5-browsers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium
maintainability
Consider using a specific version tag for the Docker image instead of 3.13.5-browsers to ensure consistency across builds. Using a specific version helps avoid unexpected changes when the image is updated.

install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
command: |
pip3 install awscli --upgrade

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium
correctness
Ensure that the awscli version is compatible with your deployment scripts. Consider specifying a version range to prevent potential breaking changes from future updates.

install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4.17 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium
correctness
Cloning a specific branch (v1.4.17) from a GitHub repository is good for consistency, but ensure that this version is tested and compatible with your current deployment process.

cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
cp ./../buildscript/psvar-processor.sh .
restore_cache_settings_for_build: &restore_cache_settings_for_build
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low
performance
Consider adding a fallback key for the cache in case the pnpm-lock.yaml file is not present or its checksum changes unexpectedly. This can help prevent cache misses.


save_cache_settings: &save_cache_settings
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }}
paths:
- node_modules


builddeploy_steps: &builddeploy_steps
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- restore_cache: *restore_cache_settings_for_build
- run:
name: "Build docker image"
command: |
./build.sh
- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
command: |
./awsconfiguration.sh $DEPLOY_ENV

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high
security
Ensure that the awsconfiguration.sh script handles the $DEPLOY_ENV variable securely and correctly, as it is critical for the deployment environment configuration.

source awsenvconf
./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar
source deployvar_env
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE
jobs:
# Build & Deploy against development backend
"build-dev":
!!merge <<: *defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "tc-mcp"
steps: *builddeploy_steps

"build-qa":
!!merge <<: *defaults
environment:
DEPLOY_ENV: "QA"
LOGICAL_ENV: "qa"
APPNAME: "tc-mcp"
steps: *builddeploy_steps

"build-prod":
!!merge <<: *defaults
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "prod"
APPNAME: "tc-mcp"
steps: *builddeploy_steps

workflows:
version: 2
build:
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
context: org-global
filters:
branches:
only:
- dev

- "build-qa":
context: org-global
filters:
branches:
only:
- qa

- "build-prod":
context: org-global
filters:
branches:
only: master
24 changes: 24 additions & 0 deletions .github/workflows/tc_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: TC Action Agent - Do It

on: issue_comment

jobs:
pr_commented:
# This job only runs for pull request comments
name: '[PR Comment] - Use TC AI Agent'
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium
correctness
The condition github.event.issue.pull_request is used to check if the event is related to a pull request. However, it might be more robust to explicitly check github.event.issue.pull_request !== null to avoid potential issues with falsy values.

runs-on: ubuntu-latest
steps:
- run: |
echo A comment on PR $NUMBER
env:
NUMBER: ${{ github.event.issue.number }}
tc_agent_tagged_in_issue_comment:
# This job only runs for issue comments where the agent is tagged with @tc-ai
name: '[Issue Comment] - Use TC AI Agent'
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium
correctness
The condition !github.event.issue.pull_request is used to check if the event is not related to a pull request. Consider explicitly checking github.event.issue.pull_request === null for clarity and to avoid potential issues with falsy values.

runs-on: ubuntu-latest
steps:
- name: Call TC AI Agent
uses: topcoder-platform/tc-action-agent@master
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
# Topcoder Model Context Protocol (MCP) Server

## Authentication Based Access via Guards

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.

#### Using `authGuard` - requires TC jwt presence for access

```ts
@Tool({
name: 'query-tc-challenges-private',
description:
'Returns a list of Topcoder challenges based on the query parameters.',
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
annotations: {
title: 'Query Public Topcoder Challenges',
readOnlyHint: true,
},
canActivate: authGuard,
})
```

#### Using `checkHasUserRole(Role.Admin)` - TC Role based guard

```ts
@Tool({
name: 'query-tc-challenges-protected',
description:
'Returns a list of Topcoder challenges based on the query parameters.',
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
annotations: {
title: 'Query Public Topcoder Challenges',
readOnlyHint: true,
},
canActivate: checkHasUserRole(Role.Admin),
})
```

#### Using `canActivate: checkM2MScope(M2mScope.QueryPublicChallenges)` - M2M based access via scopes

```ts
@Tool({
name: 'query-tc-challenges-m2m',
description:
'Returns a list of Topcoder challenges based on the query parameters.',
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS,
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA,
annotations: {
title: 'Query Public Topcoder Challenges',
readOnlyHint: true,
},
canActivate: checkM2MScope(M2mScope.QueryPublicChallenges),
})
```
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -eo pipefail
docker buildx build --no-cache=true -t ${APPNAME}}:latest .
docker buildx build --no-cache=true -t ${APPNAME}:latest .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high
correctness
There is a typo in the variable substitution syntax. The closing brace should be removed from ${APPNAME}}. It should be ${APPNAME}.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"@nestjs/common": "^11.0.1",
"@nestjs/core": "^11.0.1",
"@nestjs/platform-express": "^11.0.1",
"@rekog/mcp-nest": "^1.6.2",
"@tc/mcp-nest": "topcoder-platform/MCP-Nest.git",
"axios": "^1.10.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.2",
"dotenv": "^16.5.0",
"json-stringify-safe": "^5.0.1",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.2.0",
"nanoid": "^5.1.5",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"zod": "^3.25.67"
Expand Down
Loading