Skip to main content
Glama

A Model Context Protocol server that lets AI applications search, inspect, discover similar sounds, and download audio from Freesound using natural language.

Freesound-MCP speaks MCP over stdio, keeps no database, and runs as a single Node.js process. It is designed for Claude Desktop, Cursor, VS Code, and any other MCP-compatible host.

Contents

Related MCP server: strongerfx

Overview

  • 🔍 Search by keywords with pagination, sorting, duration ranges, license, tags, file type, category, uploader, and pack grouping.

  • 🎵 Inspect full metadata for a single sound: description, author, license, technical audio properties, preview URLs, and waveform/spectrogram images.

  • 🔗 Discover similar sounds using Freesound's acoustic and semantic similarity spaces, with relevance scores.

  • ⬇️ Download preview MP3/OGG files, or the original upload when OAuth2 is configured. Files are streamed to disk and safely named.

  • 📎 Resources and prompts for license guidance, search syntax, attribution, and layered sound-design workflows.

  • 🛡️ Resilient requests with timeouts, exponential backoff, and Retry-After support.

Tools

Tool

Description

Read-only

freesound_search

Search sounds with filters, sorting, and pagination

Yes

freesound_similar

Find sounds similar to a reference sound

Yes

freesound_get_sound

Get detailed metadata for one sound

Yes

freesound_download

Download a preview or original file to disk

No

Parameter

Type

Default

Description

query

string

— (required)

Keywords; pass an empty string to browse all sounds

page

integer

1

Page number

pageSize

integer

15

Results per page, 1-150

sort

string

score

score, duration_asc, duration_desc, created_asc, created_desc, downloads_asc, downloads_desc, rating_asc, or rating_desc

minDuration

number

—

Minimum duration in seconds

maxDuration

number

—

Maximum duration in seconds

license

string

—

Creative Commons 0, Attribution, or Attribution NonCommercial; values with spaces are quoted automatically

tags

string[]

—

Tags that every result must contain (AND)

type

string

—

wav, aif, aiff, ogg, mp3, m4a, or flac

category

string

—

Broad Sound Taxonomy category, for example Instrument samples

username

string

—

Uploader username

groupByPack

boolean

false

Return at most one sound per pack

Returns count, page, pageSize, totalPages, and results. Each result contains id, name, duration, license, preview, and, when available, username, tags, type, channels, samplerate, filesize, downloads, rating, and score.

{
  "count": 128,
  "page": 1,
  "pageSize": 15,
  "totalPages": 9,
  "results": [
    {
      "id": 123456,
      "name": "Rain on a tin roof",
      "duration": 12.4,
      "license": "Creative Commons 0",
      "preview": "https://cdn.freesound.org/previews/...",
      "username": "fieldrecordist",
      "tags": ["rain", "ambience"],
      "type": "wav",
      "samplerate": 48000,
      "downloads": 421,
      "rating": 4.6
    }
  ]
}

freesound_similar

Parameter

Type

Default

Description

soundId

integer

— (required)

Reference Freesound sound ID

page

integer

1

Page number

pageSize

integer

15

Results per page, 1-150

similaritySpace

string

API default

laion_clap (semantic + acoustic) or freesound_classic (low-level acoustic features)

Returns the same paginated structure as freesound_search, including a relevance score for every result.

freesound_get_sound

Parameter

Type

Description

soundId

integer

Freesound sound ID (required)

Returns id, name, description, tags, license, username, and duration, plus optional type, channels, samplerate, filesize, bitrate, bitdepth, created, url, downloadUrl, previewHqMp3, previewLqMp3, previewHqOgg, previewLqOgg, waveformUrl, spectrogramUrl, downloads, rating, numRatings, numComments, category, subcategory, pack, and genAiPreference.

downloadUrl points at the original file endpoint and requires OAuth2.

freesound_download

Parameter

Type

Default

Description

soundId

integer

— (required)

Freesound sound ID

quality

string

lq

hq/lq for previews, or original for the uploaded file

filename

string

generated

Output filename; unsafe characters are stripped and the extension is enforced

downloadDir

string

~/.freesound-mcp/downloads

Target directory; supports ~

Returns filePath, soundId, name, quality, format, bytes, duration, license, and sourceUrl.

Notes:

  • Preview downloads do not require OAuth2 and are MP3/OGG transcodes, not the original upload.

  • quality: "original" requires FREESOUND_OAUTH_TOKEN and downloads the file as uploaded.

  • Files are streamed to a temporary file and atomically renamed, so an interrupted download never leaves a partial file under the final name.

Resources

MCP resources provide reference material and live metadata that clients can attach as context.

URI

Description

freesound://guides/licensing

Creative Commons license table, attribution template, and checklist

freesound://guides/search

Keyword syntax, filters, sorting, pagination, and follow-up tools

freesound://sounds/{soundId}

Detailed JSON metadata for one sound (resource template)

Prompts

Prompt templates guide the model through common Freesound workflows.

Prompt

Arguments

Description

freesound_search_plan

brief, optional maxDuration, license

Plan and execute a filtered search

freesound_license_attribution

soundName, author, license, optional sourceUrl

Generate attribution text and license obligations

freesound_sound_design_palette

scene, optional mood, maxDuration

Build a layered ambience/foley/accent palette

Requirements

  • Node.js 20 or newer

  • npm 9 or newer (or pnpm/yarn)

  • A Freesound API key from the Freesound API documentation

  • Optional: a Freesound OAuth2 access token for original-quality downloads

Installation

From npm

npx -y @mushan_bit/freesound-mcp

The server speaks MCP over stdio, so it is normally launched by your MCP client rather than run by hand.

From source

git clone https://github.com/MuShan-bit/freesound-mcp.git
cd freesound-mcp
npm ci
npm run build

Directory listings

Configuration

Environment variables

Variable

Required

Default

Description

FREESOUND_API_KEY

Yes

—

API token used for search and metadata requests

FREESOUND_OAUTH_TOKEN

No

—

OAuth2 access token for quality: "original" downloads

FREESOUND_DOWNLOAD_DIR

No

~/.freesound-mcp/downloads

Default download directory

FREESOUND_TIMEOUT_MS

No

20000

Per-request timeout in milliseconds

FREESOUND_MAX_RETRIES

No

2

Retries for 429/5xx, timeouts, and network errors (0-5)

FREESOUND_RETRY_BASE_MS

No

500

Base delay for exponential backoff

FREESOUND_API_BASE_URL

No

https://freesound.org/apiv2

API base URL override (testing or proxy)

Requests that receive 429 Too Many Requests honour the Retry-After header (up to 10 seconds) before retrying. Other retryable failures use exponential backoff with jitter.

Claude Desktop

Add this to claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "freesound": {
      "command": "npx",
      "args": ["-y", "@mushan_bit/freesound-mcp"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key"
      }
    }
  }
}

To run a local build instead:

{
  "mcpServers": {
    "freesound": {
      "command": "node",
      "args": ["/absolute/path/to/freesound-mcp/build/index.js"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key",
        "FREESOUND_OAUTH_TOKEN": "optional_oauth2_token"
      }
    }
  }
}

Restart the client after editing the configuration.

Cursor

Add the same mcpServers object to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).

VS Code

Add the server to .vscode/mcp.json:

{
  "servers": {
    "freesound": {
      "command": "npx",
      "args": ["-y", "@mushan_bit/freesound-mcp"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key"
      }
    }
  }
}

Usage

Ask your AI client in natural language:

  • "Find me a rainforest ambience under 30 seconds with a Creative Commons 0 license."

  • "Search for CC0 piano samples, newest first, 5 per page."

  • "Show me the details for sound #123456."

  • "Find sounds similar to #123456."

  • "Download sound #123456 as a high-quality preview."

  • "Download the original file for #123456." (requires OAuth2)

The model calls the tools above and reports the license and author returned by Freesound.

Security and licensing

  • Keep FREESOUND_API_KEY and FREESOUND_OAUTH_TOKEN secret. Pass them through your MCP client's env block, never through source control.

  • Freesound content is licensed under Creative Commons terms. Check the license field before use, credit the author, and respect Attribution NonCommercial restrictions.

  • freesound_download writes to the local filesystem. Choose a writable downloadDir and avoid running the server with elevated privileges.

  • Filenames supplied by callers are sanitized, and downloads are written to a temporary file before being renamed into place.

Troubleshooting

Symptom

Fix

401 Unauthorized

Check FREESOUND_API_KEY and restart the client

429 Too Many Requests

Lower request frequency or increase FREESOUND_MAX_RETRIES; Freesound enforces API quotas

FREESOUND_OAUTH_TOKEN is not set

Set an OAuth2 token to use quality: "original"

"does not expose a downloadable preview"

The sound has no previews; try another sound or original download

Download fails with EACCES/ENOENT

Choose a writable downloadDir

Server missing from the client

Run npm run build, use an absolute path, and check the client's MCP logs

Development

npm ci
npm run build       # compile TypeScript to build/
npm run typecheck   # type-check without emitting
npm test            # build + run the node:test suite
npm start           # run the compiled stdio server

The test suite uses Node's built-in test runner and mocks fetch, so it runs offline without a Freesound API key. The runner collects *.test.js files explicitly, so npm test also works on Node.js 20 and Windows shells. CI runs the same commands on Node.js 20, 22, and 24.

Project layout:

  • src/index.ts — stdio entry point and shutdown handling

  • src/server.ts — MCP tool registration, schemas, and error mapping

  • src/freesound/client.ts — authenticated HTTP client, timeouts, retries

  • src/freesound/search.ts — search parameters, filters, and result mapping

  • src/freesound/similar.ts — similar-sounds endpoint

  • src/freesound/sounds.ts — sound details, preview/original downloads

  • src/freesound/errors.ts — structured error types

  • src/resources.ts — MCP resources and the sound metadata template

  • src/prompts.ts — MCP prompt templates

  • server.json — official MCP Registry metadata

  • test/ — unit tests, in-memory MCP tests, and a real stdio end-to-end test

Contributing

Contributions are welcome! Please open an issue first for major changes, then submit a pull request. Keep the test suite green and update the README and CHANGELOG for user-visible changes.

License

This project is licensed under the MIT License — see LICENSE for details.

Acknowledgments

Available Tools

2 tools
freesound.downloadC

Download a sound from Freesound by sound ID

Inputs: soundId (required).

freesound.searchC

Search sounds from Freesound

Inputs: query (required), maxDuration, license.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have completely distinct purposes: one is for downloading a specific sound by ID, and the other is for searching sounds based on criteria. There is no overlap or ambiguity between these operations, making it clear when to use each tool.

    Naming Consistency5/5

    Both tools follow a consistent naming pattern with the prefix 'freesound.' followed by a verb (download, search) that clearly describes the action. This uniformity makes the tool set predictable and easy to understand.

    Tool Count2/5

    With only two tools, the server feels too minimal for a comprehensive Freesound integration. While search and download are core operations, obvious gaps like browsing, getting sound details, or managing user content are missing, limiting functionality.

    Completeness2/5

    The tool set is severely incomplete for interacting with Freesound. It lacks essential operations such as retrieving sound metadata, listing categories, or handling user authentication, which are necessary for full agent workflows in this domain.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Integrates with Freesound.org to enable searching, discovering, and previewing audio content such as sound effects and music loops. It provides detailed metadata and licensing information to support video editing and content creation workflows.
      11
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides local MCP tools to search and retrieve CC0 sound effects by keyword, category, duration, or ID, along with metadata, previews, and WAV/MP3 download URLs.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants and code to search a large library of free sound effects, music, and ambience by keywords and filters such as type, length, tempo, key, mood, and use case. It also exposes full metadata for individual sounds and themed packs, plus download links with ready-to-run curl commands for pulling the full-quality files.
      1
      MIT